diff options
| author | gingerBill <bill@gingerbill.org> | 2024-12-02 11:23:55 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-12-02 11:23:55 +0000 |
| commit | e2ba8ff6e6fdbd23a10dcaf8b04f85960b8aa7c3 (patch) | |
| tree | 381714533720ae7f89e5345c5e997a1192acf377 /src/string.cpp | |
| parent | d0f87913e2133b8101faef6ea76e0853d4da524b (diff) | |
Fix #4530
Diffstat (limited to 'src/string.cpp')
| -rw-r--r-- | src/string.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/string.cpp b/src/string.cpp index f8ee6c53e..b001adf0e 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -718,12 +718,12 @@ gb_internal bool unquote_char(String s, u8 quote, Rune *rune, bool *multiple_byt Rune r = -1; isize size = utf8_decode(s.text, s.len, &r); *rune = r; - *multiple_bytes = true; - *tail_string = make_string(s.text+size, s.len-size); + if (multiple_bytes) *multiple_bytes = true; + if (tail_string) *tail_string = make_string(s.text+size, s.len-size); return true; } else if (s[0] != '\\') { *rune = s[0]; - *tail_string = make_string(s.text+1, s.len-1); + if (tail_string) *tail_string = make_string(s.text+1, s.len-1); return true; } @@ -809,10 +809,10 @@ gb_internal bool unquote_char(String s, u8 quote, Rune *rune, bool *multiple_byt return false; } *rune = r; - *multiple_bytes = true; + if (multiple_bytes) *multiple_bytes = true; } break; } - *tail_string = s; + if (tail_string) *tail_string = s; return true; } |