Re: :PgSQL: More Queestions
От | David Wheeler |
---|---|
Тема | Re: :PgSQL: More Queestions |
Дата | |
Msg-id | 52C36595-FDB0-11D6-8943-0003931A964A@wheeler.net обсуждение исходный текст |
Список | 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 по дате отправления: