From f9cb77728cc5cc2889ad447c4ff44b8b76ca13b3 Mon Sep 17 00:00:00 2001
From: Sojourner Truth <jon.w.wilkes@gmail.com>
Date: Tue, 28 Jun 2016 22:17:12 -0400
Subject: [PATCH] quick fix for backslashes in legacy tcl commands breaking the
 GUI parser-- just send "dummy" command arg

---
 pd/nw/pdgui.js   | 2 +-
 pd/src/s_inter.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js
index 80664e7af..242c64b23 100644
--- a/pd/nw/pdgui.js
+++ b/pd/nw/pdgui.js
@@ -347,7 +347,7 @@ function gui_post_error(objectid, loglevel, errormsg) {
 }
 
 function gui_legacy_tcl_command(file, line_number, text) {
-    post("legacy tcl command at " + line_number + " of " + file + ": " + text);
+    post("legacy tcl command at " + line_number + " of " + file);
 }
 
 function clear_console() {
diff --git a/pd/src/s_inter.c b/pd/src/s_inter.c
index b6e4d129f..88fb1974a 100644
--- a/pd/src/s_inter.c
+++ b/pd/src/s_inter.c
@@ -951,8 +951,11 @@ void sys_vguid(const char *file, int line, const char *fmt, ...)
             strncat(bufp, "...", MAXPDSTRING);
         }
     }
+    /* For now, we're sending a dummy string instead of bufp to the GUI.
+       Unlike Pd messages, old tcl commands can contain stray backslashes
+       that can mess up the double quote delimiters for strings in gui_vmess.*/
     gui_vmess("gui_legacy_tcl_command", "sis",
-        file, line, bufp);
+        file, line, "dummy");
     //sys_vvguid(file,line,fmt,ap);
 }
 
-- 
GitLab