diff options
-rw-r--r-- | qobject/json-lexer.c | 4 | ||||
-rw-r--r-- | tests/check-qjson.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c index 440df60392..b19623e229 100644 --- a/qobject/json-lexer.c +++ b/qobject/json-lexer.c @@ -138,8 +138,8 @@ static const uint8_t json_lexer[][256] = { ['n'] = IN_SQ_STRING, ['r'] = IN_SQ_STRING, ['t'] = IN_SQ_STRING, - ['/'] = IN_DQ_STRING, - ['\\'] = IN_DQ_STRING, + ['/'] = IN_SQ_STRING, + ['\\'] = IN_SQ_STRING, ['\''] = IN_SQ_STRING, ['\"'] = IN_SQ_STRING, ['u'] = IN_SQ_UCODE0, diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 4e74548109..95497a037e 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -45,6 +45,13 @@ static void escaped_string(void) { "\"single byte utf-8 \\u0020\"", "single byte utf-8 ", .skip = 1 }, { "\"double byte utf-8 \\u00A2\"", "double byte utf-8 \xc2\xa2" }, { "\"triple byte utf-8 \\u20AC\"", "triple byte utf-8 \xe2\x82\xac" }, + { "'\\b'", "\b", .skip = 1 }, + { "'\\f'", "\f", .skip = 1 }, + { "'\\n'", "\n", .skip = 1 }, + { "'\\r'", "\r", .skip = 1 }, + { "'\\t'", "\t", .skip = 1 }, + { "'\\/'", "/", .skip = 1 }, + { "'\\\\'", "\\", .skip = 1 }, {} }; |