aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/json.c6
-rw-r--r--test/src/json-tests.el4
2 files changed, 4 insertions, 6 deletions
diff --git a/src/json.c b/src/json.c
index 8749009a24b..ca9be26cd9f 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1655,9 +1655,9 @@ json_parse_value (struct json_parser *parser, int c)
1655 return json_parse_number (parser, c); 1655 return json_parse_number (parser, c);
1656 else 1656 else
1657 { 1657 {
1658 int c2 = json_input_get (parser); 1658 int c2 = json_input_get_if_possible (parser);
1659 int c3 = json_input_get (parser); 1659 int c3 = json_input_get_if_possible (parser);
1660 int c4 = json_input_get (parser); 1660 int c4 = json_input_get_if_possible (parser);
1661 int c5 = json_input_get_if_possible (parser); 1661 int c5 = json_input_get_if_possible (parser);
1662 1662
1663 if (c == 't' && c2 == 'r' && c3 == 'u' && c4 == 'e' 1663 if (c == 't' && c2 == 'r' && c3 == 'u' && c4 == 'e'
diff --git a/test/src/json-tests.el b/test/src/json-tests.el
index a1bafadaa87..628a5a3de57 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -215,11 +215,9 @@
215 (should-error (json-serialize ["u\u00C4\xCCv"]) :type 'wrong-type-argument)) 215 (should-error (json-serialize ["u\u00C4\xCCv"]) :type 'wrong-type-argument))
216 216
217(ert-deftest json-parse-string/short () 217(ert-deftest json-parse-string/short ()
218 :expected-result :failed
219 (should-error (json-parse-string "") :type 'json-end-of-file) 218 (should-error (json-parse-string "") :type 'json-end-of-file)
220 (should-error (json-parse-string " ") :type 'json-end-of-file) 219 (should-error (json-parse-string " ") :type 'json-end-of-file)
221 ;; BUG: currently results in `json-end-of-file' for short non-empty inputs. 220 (dolist (s '("a" "ab" "abc" "abcd" "\0" "\1"
222 (dolist (s '("a" "ab" "abc" "abcd"
223 "t" "tr" "tru" "truE" "truee" 221 "t" "tr" "tru" "truE" "truee"
224 "n" "nu" "nul" "nulL" "nulll" 222 "n" "nu" "nul" "nulL" "nulll"
225 "f" "fa" "fal" "fals" "falsE" "falsee")) 223 "f" "fa" "fal" "fals" "falsE" "falsee"))