This commit is contained in:
Araq 2018-09-03 08:37:32 +02:00
commit fa338768a3
2 changed files with 10 additions and 2 deletions

View file

@ -3972,7 +3972,7 @@ proc addQuoted*[T](s: var string, x: T) =
## tmp.add(", ")
## tmp.addQuoted('c')
## assert(tmp == """1, "string", 'c'""")
when T is string:
when T is string or T is cstring:
s.add("\"")
for c in x:
# Only ASCII chars are escaped to avoid butchering