diff options
| author | gingerBill <bill@gingerbill.org> | 2024-07-14 22:23:46 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-07-14 22:23:46 +0100 |
| commit | 95a695e4cda01c8c1b12eb799c0bde8b3a282f4d (patch) | |
| tree | a4bfde9f6fda996220ba4247ae6fbbb0ab352198 /core/encoding | |
| parent | 251fa477afc8da08ad353935deab24fc32ec18b6 (diff) | |
Fix #3926
Diffstat (limited to 'core/encoding')
| -rw-r--r-- | core/encoding/ini/ini.odin | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/encoding/ini/ini.odin b/core/encoding/ini/ini.odin index 91a1adcf7..a63564220 100644 --- a/core/encoding/ini/ini.odin +++ b/core/encoding/ini/ini.odin @@ -82,14 +82,16 @@ Map :: distinct map[string]map[string]string load_map_from_string :: proc(src: string, allocator: runtime.Allocator, options := DEFAULT_OPTIONS) -> (m: Map, err: runtime.Allocator_Error) { unquote :: proc(val: string) -> (string, runtime.Allocator_Error) { - v, allocated, ok := strconv.unquote_string(val) - if !ok { - return strings.clone(val) - } - if allocated { - return v, nil + if strings.has_prefix(val, `"`) || strings.has_prefix(val, `'`) { + v, allocated, ok := strconv.unquote_string(val) + if !ok { + return strings.clone(val) + } + if allocated { + return v, nil + } } - return strings.clone(v) + return strings.clone(val) } |