From 681e32e442d4d86c5f031d242fe7bbdfbf478ad8 Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Fri, 18 Mar 2016 14:46:07 -0400
Subject: [PATCH] fix regression where Pd would eat the first character of a
 symbol if the symbol contained a double quote.

---
 pd/src/s_inter.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c
index 6074974e2..a2e2efc13 100644
--- a/pd/src/s_inter.c
+++ b/pd/src/s_inter.c
@@ -760,11 +760,14 @@ void sys_gui(const char *s)
 static void escape_double_quotes(const char *src) {
     int dq = 0, len = 0;
     const char *s = src;
-    while(*s++)
+    while(*s)
     {
         len++;
         if (*s == '\"')
+        {
             dq++;
+        }
+        s++;
     }
     if (!dq)
         sys_vgui("\"%s\"", src);
@@ -773,7 +776,7 @@ static void escape_double_quotes(const char *src) {
         char *dest = (char *)t_getbytes((len+dq+1)*sizeof(*dest));
         char *tmp = dest;
         s = src;
-        while(*s++)
+        while(*s)
         {
             if (*s == '\"')
             {
@@ -781,7 +784,10 @@ static void escape_double_quotes(const char *src) {
                 *tmp++ = '\"';
             }
             else
+            {
                 *tmp++ = *s;
+            }
+            s++;
         }
         *tmp = '\0'; /* null terminate */
         sys_vgui("\"%s\"", dest);
-- 
GitLab