From 1ffdd15e02cc81b74d3337e7412e4cc0da885fe6 Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@vt.edu>
Date: Sat, 30 Aug 2014 01:44:28 -0400
Subject: [PATCH] *fixed regression where array canvas properties did not stick
 *fixed proper opening of paths with spaces ia unique check

---
 pd/src/g_array.c  | 2 +-
 pd/src/g_editor.c | 1 +
 pd/src/pd.tk      | 2 ++
 pd/src/s_main.c   | 4 +++-
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pd/src/g_array.c b/pd/src/g_array.c
index 7a8a37ba7..cbd88cede 100644
--- a/pd/src/g_array.c
+++ b/pd/src/g_array.c
@@ -401,7 +401,7 @@ void garray_fittograph(t_garray *x, int n, int flag)
         /* close any dialogs that might have the wrong info now... 
         TODO: make changes dynamic to avoid this as it causes Apply to
         close the properties which is annoying */
-        gfxstub_deleteforkey(gl);
+        //gfxstub_deleteforkey(gl);
     }
     if (flag >= 0)
     {
diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index 9329aad7b..ebb3aa434 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -2631,6 +2631,7 @@ void canvas_properties(t_glist *x)
 static void canvas_donecanvasdialog(t_glist *x,
     t_symbol *s, int argc, t_atom *argv)
 {
+    //fprintf(stderr,"canvas_donecanvasdialog\n");
     t_float xperpix, yperpix, x1, y1, x2, y2, xpix, ypix, xmargin, ymargin;
     int rx1=0, ry1=0, rx2=0, ry2=0; //for getrect
     int graphme;
diff --git a/pd/src/pd.tk b/pd/src/pd.tk
index a6893c8a5..65b27a078 100644
--- a/pd/src/pd.tk
+++ b/pd/src/pd.tk
@@ -6372,6 +6372,7 @@ if {[catch {
 # see comments above (pdtk_gatom_dialog) about variable name handling 
 
 proc canvas_apply {id} {
+	# puts stderr pdtk_canvas_apply
     # strip "." from the TK id to make a variable name suffix 
     set vid [string trimleft $id .]
     # for each variable, make a local variable to hold its name...
@@ -8454,6 +8455,7 @@ proc pdtk_check_unique {unique filenames} {
 	global appname
 	if { $unique == 0 } {
 		foreach file $filenames {
+			#puts stderr $file
 			cd [file dirname $file]
 			set dir [pwd]
 			set name [file tail $file]
diff --git a/pd/src/s_main.c b/pd/src/s_main.c
index 531eb8ef6..6ef5121d6 100644
--- a/pd/src/s_main.c
+++ b/pd/src/s_main.c
@@ -313,13 +313,15 @@ int sys_main(int argc, char **argv)
         if((filenames = malloc(length)) != NULL)
         {
             filenames[0] = '\0';   // ensures the memory is an empty string
+            strcat(filenames,"\"");
             if (sys_openlist)
             {
                 for (nl = sys_openlist; nl; nl = nl->nl_next)
                 {
                     strcat(filenames,nl->nl_string);
                     if (nl->nl_next)
-                        strcat(filenames," ");
+                        strcat(filenames,"\" \"");
+                    else strcat(filenames,"\"");
                 }
             }
             //fprintf(stderr,"final list: <%s>\n", filenames);
-- 
GitLab