summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorEuan T <euantorano@users.noreply.github.com>2016-06-16 18:40:35 +0100
committertreeform <starplant@gmail.com>2017-12-14 18:36:18 +0000
commitc678ac3f33d67cf39df777ca2c8440a6cabcc0b7 (patch)
treed139d8562adfd4cb25d75d6114a1a0a708b11dee
parentee5a76fd9d463b7c7628e2c6625238febc513401 (diff)
downloadNim-c678ac3f33d67cf39df777ca2c8440a6cabcc0b7.tar.gz
Expand dbQuote to handle backslashes
-rw-r--r--lib/impure/db_mysql.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/impure/db_mysql.nim b/lib/impure/db_mysql.nim
index 1b79b3543..e1119ada6 100644
--- a/lib/impure/db_mysql.nim
+++ b/lib/impure/db_mysql.nim
@@ -120,6 +120,7 @@ proc dbQuote*(s: string): string =
   result = "'"
   for c in items(s):
     if c == '\'': add(result, "''")
+    if c == '\\': add(result, "\\\\")
     else: add(result, c)
   add(result, '\'')