mirror of
https://github.com/json-c/json-c.git
synced 2026-04-02 11:59:07 +08:00
In the json_tokener_state_number case, explicitly adjust what "number" characters are allowed based on the exact micro-state that we're in, and check for invalid following characters in a different way, to allow a valid json_type_number object to be returned at the top level.
This causes previously failing strings like "123-456" to return a valid json_object with the appropriate value. If you care about the trailing content, call json_tokener_parse_ex() and check the parse end point with json_tokener_get_parse_end().
This commit is contained in:
@@ -30,6 +30,9 @@ Other changes
|
||||
* Fix incremental parsing of numbers, especially those with exponents, e.g.
|
||||
so parsing "[0", "e+", "-]" now properly returns an error.
|
||||
Strict mode now rejects missing exponents ("0e").
|
||||
* Successfully return number objects at the top level even when they are
|
||||
followed by a "-", "." or "e". This makes parsing things like "123-45"
|
||||
behave consistently with things like "123xyz".
|
||||
|
||||
|
||||
***
|
||||
|
||||
Reference in New Issue
Block a user