emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/emacsql 6f1e375a2e 367/427: Better escaping of NUL and con


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 6f1e375a2e 367/427: Better escaping of NUL and control characters (#42)
Date: Tue, 13 Dec 2022 03:00:11 -0500 (EST)

branch: elpa/emacsql
commit 6f1e375a2ebb558138b73d2a63f2077da1028f92
Author: Christopher Wellons <wellons@nullprogram.com>
Commit: Christopher Wellons <wellons@nullprogram.com>

    Better escaping of NUL and control characters (#42)
---
 emacsql-compiler.el | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/emacsql-compiler.el b/emacsql-compiler.el
index bfa03f228c..c16e774a2e 100644
--- a/emacsql-compiler.el
+++ b/emacsql-compiler.el
@@ -55,9 +55,6 @@
     (while (re-search-forward "'" nil t)
       (replace-match "''"))
     (setf (point) (point-min))
-    (while (re-search-forward "\0" nil t)
-      (replace-match "\\\\0"))
-    (setf (point) (point-min))
     (insert "'")
     (setf (point) (point-max))
     (insert "'")
@@ -93,7 +90,8 @@
 
 (defun emacsql-escape-scalar (value)
   "Escape VALUE for sending to SQLite."
-  (let ((print-escape-newlines t))
+  (let ((print-escape-newlines t)
+        (print-escape-control-characters t))
     (cond ((null value) "NULL")
           ((numberp value) (prin1-to-string value))
           ((emacsql-quote-scalar (prin1-to-string value))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]