patch 7.4.1238

Problem:    Can't handle two messages right after each other.
Solution:   Find the end of the JSON.  Read more when incomplete.  Add a C
            test for the JSON decoding.
This commit is contained in:
Bram Moolenaar
2016-02-02 18:20:08 +01:00
parent d9ea9069f5
commit 56ead341a7
9 changed files with 535 additions and 140 deletions

View File

@@ -14100,9 +14100,9 @@ f_jsondecode(typval_T *argvars, typval_T *rettv)
js_read_T reader;
reader.js_buf = get_tv_string(&argvars[0]);
reader.js_eof = TRUE;
reader.js_fill = NULL;
reader.js_used = 0;
if (json_decode(&reader, rettv) == FAIL)
if (json_decode_all(&reader, rettv) != OK)
EMSG(_(e_invarg));
}