diff options
author | Florian Frank <flori@ping.de> | 2016-06-21 10:14:36 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2016-06-21 10:14:36 +0200 |
commit | e33584dfe582e8b0b6bcf1fe14099a9801275ce3 (patch) | |
tree | 85d8e55d0ae030dac6503fc36f3e0f05bef1f00f | |
parent | e16dab51937894c674c07660cc0916a08af2e165 (diff) | |
parent | ca0ffe9718d61d59090cfc0d567400e264bf6866 (diff) | |
download | json-e33584dfe582e8b0b6bcf1fe14099a9801275ce3.tar.gz |
Merge branch 'master' of github.com:flori/json
-rw-r--r-- | ext/json/ext/parser/parser.c | 2 | ||||
-rw-r--r-- | ext/json/ext/parser/parser.rl | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/ext/json/ext/parser/parser.c b/ext/json/ext/parser/parser.c index 8d83808..7e32ef0 100644 --- a/ext/json/ext/parser/parser.c +++ b/ext/json/ext/parser/parser.c @@ -1647,6 +1647,8 @@ case 7: if (json->symbolize_names && json->parsing_name) { *result = rb_str_intern(*result); + } else { + rb_str_resize(*result, RSTRING_LEN(*result)); } if (cs >= JSON_string_first_final) { return p + 1; diff --git a/ext/json/ext/parser/parser.rl b/ext/json/ext/parser/parser.rl index 04d1b47..f479281 100644 --- a/ext/json/ext/parser/parser.rl +++ b/ext/json/ext/parser/parser.rl @@ -542,6 +542,8 @@ static char *JSON_parse_string(JSON_Parser *json, char *p, char *pe, VALUE *resu if (json->symbolize_names && json->parsing_name) { *result = rb_str_intern(*result); + } else { + rb_str_resize(*result, RSTRING_LEN(*result)); } if (cs >= JSON_string_first_final) { return p + 1; |