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

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

[nongnu] elpa/emacsql 3e16afce8b 281/427: Escape backslashes as well.


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 3e16afce8b 281/427: Escape backslashes as well.
Date: Tue, 13 Dec 2022 02:59:51 -0500 (EST)

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

    Escape backslashes as well.
---
 sqlite/emacsql.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sqlite/emacsql.c b/sqlite/emacsql.c
index a3f4484d7b..34b3481c10 100644
--- a/sqlite/emacsql.c
+++ b/sqlite/emacsql.c
@@ -9,14 +9,14 @@
 char* escape(const char *message) {
     int i, count = 0, length_orig = strlen(message);
     for (i = 0; i < length_orig; i++) {
-        if (message[i] == '"') {
+        if (strchr("\"\\", message[i])) {
             count++;
         }
     }
     char *copy = malloc(length_orig + count + 1);
     char *p = copy;
     while (*message) {
-        if (*message == '"') {
+        if (strchr("\"\\", *message)) {
             *p = '\\';
             p++;
         }



reply via email to

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