diff scripts/path/savepath.m @ 7393:a2e8cfe2fd17

[project @ 2008-01-17 08:46:54 by jwe]
author jwe
date Thu, 17 Jan 2008 08:46:54 +0000
parents 17f2cdb5232e
children 31ab3b83bc8a
line wrap: on
line diff
--- a/scripts/path/savepath.m
+++ b/scripts/path/savepath.m
@@ -113,9 +113,10 @@
     endfor
 
     ## Use single quotes for PATH argument to avoid string escape
-    ## processing.
-    fprintf (fid, "%s\n  path ('%s');\n%s\n",
-	     beginstring, path (), endstring);
+    ## processing.  Since we are using single quotes around the arg,
+    ## double any single quote characters found in the string.
+    fprintf (fid, "\n%s\n  path ('%s');\n%s\n",
+	     beginstring, strrep (path (), "'", "''"), endstring);
 
     for i = 1:length (post)
       fprintf (fid, "%s\n", post{i});