Re: :PgSQL: More Queestions

From: David Wheeler <david(at)wheeler(dot)net>
To: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
Cc: Jeff Urlwin <jurlwin(at)bellatlantic(dot)net>, dbi-dev(at)perl(dot)org, pgsql-interfaces(at)postgresql(dot)org
Subject: Re: :PgSQL: More Queestions
Date: 2002-11-22 00:21:19
Message-ID: 52C36595-FDB0-11D6-8943-0003931A964A@wheeler.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)wheeler(dot)net ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory(at)jabber(dot)org

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message David Wheeler 2002-11-22 01:08:31 Re: :PgSQL: More Queestions
Previous Message David Wheeler 2002-11-22 00:11:11 Re: :PgSQL: More Queestions