aboutsummaryrefslogtreecommitdiff
path: root/core/encoding
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-14 22:25:26 +0100
committergingerBill <bill@gingerbill.org>2024-07-14 22:25:26 +0100
commit9d84e00502dc413c3f00ece672be2142dcdd845b (patch)
tree8faeeb15811775457fc003c821a94d5a64cfb48d /core/encoding
parent7703b37a1b1cd754c1eed99111189f0656235650 (diff)
Clean up `unquote` code
Diffstat (limited to 'core/encoding')
-rw-r--r--core/encoding/ini/ini.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/encoding/ini/ini.odin b/core/encoding/ini/ini.odin
index a63564220..6723da2b3 100644
--- a/core/encoding/ini/ini.odin
+++ b/core/encoding/ini/ini.odin
@@ -82,7 +82,7 @@ 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) {
- if strings.has_prefix(val, `"`) || strings.has_prefix(val, `'`) {
+ if len(val) > 0 && (val[0] == '"' || val[0] == '\'') {
v, allocated, ok := strconv.unquote_string(val)
if !ok {
return strings.clone(val)