about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-08-19 09:56:55 +0200
committerbptato <nincsnevem662@gmail.com>2023-08-19 10:02:17 +0200
commit01dfb3abe8d3a282a127aafd34e55fff1ff9d2df (patch)
tree36104b6aedfe1d82636133f8da441f04afe5122b /src
parentca30c22f03870b8f8aa37939f2f3db737e6a1737 (diff)
downloadchawan-01dfb3abe8d3a282a127aafd34e55fff1ff9d2df.tar.gz
toml: fix quotation chars in multiline strings
Diffstat (limited to 'src')
-rw-r--r--src/config/toml.nim16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/config/toml.nim b/src/config/toml.nim
index 66f8335f..a4e13dea 100644
--- a/src/config/toml.nim
+++ b/src/config/toml.nim
@@ -159,13 +159,15 @@ proc consumeString(state: var TomlParser, first: char):
     if c == '\n' and not multiline:
       return state.err("newline in string")
     elif c == first:
-      if multiline and state.has(1):
-        let c2 = state.peek(0)
-        let c3 = state.peek(1)
-        if c2 == first and c3 == first:
-          discard state.consume()
-          discard state.consume()
-          break
+      if multiline:
+        if state.has(1):
+          let c2 = state.peek(0)
+          let c3 = state.peek(1)
+          if c2 == first and c3 == first:
+            discard state.consume()
+            discard state.consume()
+            break
+        res &= c
       else:
         break
     elif first == '"' and c == '\\':