[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/40] json-lexer: fix escaped backslash in single-qu
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 04/40] json-lexer: fix escaped backslash in single-quoted string |
Date: |
Thu, 19 Jun 2014 15:39:16 -0400 |
From: Paolo Bonzini <address@hidden>
This made the lexer wait for a closing *double* quote.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Amos Kong <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
qobject/json-lexer.c | 4 ++--
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 440df60..b19623e 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 4e74548..95497a0 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 },
{}
};
--
1.9.3
- [Qemu-devel] [PULL for-2.1 00/40] QMP queue, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 01/40] qapi: fix coding style in parameters list, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 02/40] qapi: add const prefix to 'char *' insider c_type(), Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 03/40] qapi: Suppress unwanted space between type and identifier, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 06/40] qapi: Add includes from qapi/ as dependencies, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 08/40] qapi script: add event support, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 05/40] os-posix: include sys/time.h, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 09/40] test: add test cases for qapi event, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 04/40] json-lexer: fix escaped backslash in single-quoted string,
Luiz Capitulino <=
- [Qemu-devel] [PULL 07/40] qapi: add event helper functions, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 11/40] monitor: add an implemention of qapi event emit method, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 10/40] qapi: adjust existing defines, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 14/40] qapi event: convert POWERDOWN, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 15/40] qapi event: convert RESET, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 17/40] qapi event: convert RESUME, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 13/40] qapi event: convert SHUTDOWN, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 19/40] qapi event: convert SUSPEND_DISK, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 20/40] qapi event: convert WAKEUP, Luiz Capitulino, 2014/06/19
- [Qemu-devel] [PULL 18/40] qapi event: convert SUSPEND, Luiz Capitulino, 2014/06/19