diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c
index b6e4d129fc07baf03f64e043a02b2db1bdb2946b..cbae4754e8dc24d3f606a0c1d384065f747852c4 100644
--- a/pd/src/s_inter.c
+++ b/pd/src/s_inter.c
@@ -756,7 +756,7 @@ static void escape_double_quotes(const char *src) {
     while(*s)
     {
         len++;
-        if (*s == '\"')
+        if (*s == '\"' || *s == '\\')
         {
             dq++;
         }
@@ -771,10 +771,10 @@ static void escape_double_quotes(const char *src) {
         s = src;
         while(*s)
         {
-            if (*s == '\"')
+            if (*s == '\"' || *s == '\\')
             {
                 *tmp++ = '\\';
-                *tmp++ = '\"';
+                *tmp++ = *s;
             }
             else
             {