Revision bd3924a3
b/json-lexer.c | ||
---|---|---|
274 | 274 |
lexer->x = lexer->y = 0; |
275 | 275 |
} |
276 | 276 |
|
277 |
static int json_lexer_feed_char(JSONLexer *lexer, char ch) |
|
277 |
static int json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush)
|
|
278 | 278 |
{ |
279 | 279 |
int char_consumed, new_state; |
280 | 280 |
|
... | ... | |
313 | 313 |
break; |
314 | 314 |
} |
315 | 315 |
lexer->state = new_state; |
316 |
} while (!char_consumed); |
|
316 |
} while (!char_consumed && !flush);
|
|
317 | 317 |
|
318 | 318 |
/* Do not let a single token grow to an arbitrarily large size, |
319 | 319 |
* this is a security consideration. |
... | ... | |
335 | 335 |
for (i = 0; i < size; i++) { |
336 | 336 |
int err; |
337 | 337 |
|
338 |
err = json_lexer_feed_char(lexer, buffer[i]); |
|
338 |
err = json_lexer_feed_char(lexer, buffer[i], false);
|
|
339 | 339 |
if (err < 0) { |
340 | 340 |
return err; |
341 | 341 |
} |
Also available in: Unified diff