Re: :PgSQL: More Queestions - Mailing list pgsql-interfaces

From David Wheeler
Subject Re: :PgSQL: More Queestions
Date
Msg-id 52C36595-FDB0-11D6-8943-0003931A964A@wheeler.net
Whole thread Raw
List pgsql-interfaces
On Thursday, November 21, 2002, at 01:23  AM, Tim Bunce wrote:

>>         if (*src == '"' || *src == '\'') {
>>             if (!in_literal) {
>>                 literal_ch = *src;
>>                 in_literal = 1;
>
> No need for in_literal as literal_ch can serve as a flag as well.

Right.

>>             } else {
>>                 if (*src == literal_ch && *(src-1) != '//'
>>                     && *(src-1) != literal_ch) {
>>                     in_literal = 0;
>>                 }
>>             }
>>         }
>
> Can't distinguish between
>     "....\\\\"    - final double quote ends the string
>     "...\\\\\"    - final double quote is escaped and string continues...

Right...I realized just as I was passing out last night that it would 
miss-parse terminal escapes. and such.

> If the original code isn't broken it doesn't need fixing, maybe
> just commenting.

Absolutely.

Best,

David

-- 
David Wheeler                                     AIM: dwTheory
david@wheeler.net                                 ICQ: 15726394
http://david.wheeler.net/                      Yahoo!: dew7e                                               Jabber:
Theory@jabber.org



pgsql-interfaces by date:

Previous
From: David Wheeler
Date:
Subject: Re: :PgSQL: More Queestions
Next
From: David Wheeler
Date:
Subject: Re: :PgSQL: More Queestions