diff options
author | m-holger <m-holger@kubitscheck.org> | 2023-01-26 14:31:53 +0100 |
---|---|---|
committer | m-holger <m-holger@kubitscheck.org> | 2023-02-04 14:53:22 +0100 |
commit | fcc123a62a9fb1cf00288255be8d5c904e43402c (patch) | |
tree | 99a33ff4b4c587ccf10b6c2772934afb30b20343 /libqpdf | |
parent | bb89a60320c44199e40c24c3c4681d4a2e41ff97 (diff) | |
download | qpdf-fcc123a62a9fb1cf00288255be8d5c904e43402c.tar.zst |
Avoid copying delimiters in JSONParser::getToken
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/JSON.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libqpdf/JSON.cc b/libqpdf/JSON.cc index 5950f920..218ea724 100644 --- a/libqpdf/JSON.cc +++ b/libqpdf/JSON.cc @@ -871,21 +871,27 @@ JSONParser::getToken() action = ignore; } else if (*p == ',') { lex_state = ls_comma; + action = ignore; ready = true; } else if (*p == ':') { lex_state = ls_colon; + action = ignore; ready = true; } else if (*p == '{') { lex_state = ls_begin_dict; + action = ignore; ready = true; } else if (*p == '}') { lex_state = ls_end_dict; + action = ignore; ready = true; } else if (*p == '[') { lex_state = ls_begin_array; + action = ignore; ready = true; } else if (*p == ']') { lex_state = ls_end_array; + action = ignore; ready = true; } else if ((*p >= 'a') && (*p <= 'z')) { lex_state = ls_alpha; |