fixed a rare parsing bug where too many tokens would be detected if the staging buffer was broken directly before the second quotation mark in a key string

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401736
This commit is contained in:
David Anderson 2007-11-27 17:25:16 +00:00
parent b98edf88b6
commit c92048fefb

View File

@ -408,8 +408,8 @@ SMCError TextParsers::ParseStream_SMC(void *stream,
{ {
if (in_quote) if (in_quote)
{ {
/* If i was 0, this case is impossible due to reparsing */ /* If i was 0, we could have reparsed, so make sure there's no buffer underrun */
if ((i != 0) && c == '"' && parse_point[i-1] != '\\') if ((&parse_point[i] != in_buf) && c == '"' && parse_point[i-1] != '\\')
{ {
/* If we reached a quote in an ignore phase, /* If we reached a quote in an ignore phase,
* we're staging a string and we must rotate it out. * we're staging a string and we must rotate it out.