mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 15:44:14 +00:00
Escape %00 / \0 in dbQuote (#18015) [backport:1.4]
Fix https://github.com/nim-lang/Nim/issues/17925
This commit is contained in:
committed by
ringabout
parent
2b6e1d4836
commit
9f35bb3968
@@ -110,7 +110,9 @@ proc dbQuote*(s: string): string =
|
||||
## DB quotes the string.
|
||||
result = "'"
|
||||
for c in items(s):
|
||||
if c == '\'': add(result, "''")
|
||||
case c
|
||||
of '\'': add(result, "''")
|
||||
of '\0': add(result, "\\0")
|
||||
else: add(result, c)
|
||||
add(result, '\'')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user