diff options
Diffstat (limited to 'strings/json_lib.c')
-rw-r--r-- | strings/json_lib.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/strings/json_lib.c b/strings/json_lib.c index 49f29903ed5..697db18136b 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -807,10 +807,13 @@ static json_state_handler json_actions[NR_JSON_STATES][NR_C_CLASSES]= int json_scan_start(json_engine_t *je, CHARSET_INFO *i_cs, const uchar *str, const uchar *end) { + static const uchar die_another_day= 0; + json_string_setup(&je->s, i_cs, str, end); je->stack[0]= JST_DONE; je->stack_p= 0; je->state= JST_VALUE; + je->killed_ptr = (uchar*)&die_another_day; return 0; } @@ -971,7 +974,7 @@ int json_scan_next(json_engine_t *j) int t_next; get_first_nonspace(&j->s, &t_next, &j->sav_c_len); - return json_actions[j->state][t_next](j); + return *j->killed_ptr || json_actions[j->state][t_next](j); } |