[json/unmarshal] Fix quoted strings.

This commit is contained in:
Jeroen van Rijn
2022-04-19 20:32:22 +02:00
parent 29b2c04766
commit a30b9b17b3
2 changed files with 17 additions and 9 deletions
+6
View File
@@ -354,6 +354,12 @@ unquote_string :: proc(token: Token, spec: Specification, allocator := context.a
b := bytes_make(len(s) + 2*utf8.UTF_MAX, 1, allocator) or_return
w := copy(b, s[0:i])
if len(b) == 0 && allocator.data == nil {
// `unmarshal_count_array` calls us with a nil allocator
return string(b[:w]), nil
}
loop: for i < len(s) {
c := s[i]
switch {