changeset 14403:61cc4c715962

Replace file-separater "/" with "\" for MinGW MSYS shell. * __print_parse_opts__.m: For the print() utilities (ghostscript, epstool, fig2dev, pstoedit) full-file names replace file-separater "/" with "\" for MinGW MSYS shell.
author Ben Abbott <bpabbott@mac.com>
date Fri, 24 Feb 2012 07:57:50 -0500
parents cbcaf5602469
children 7d5a653825b9
files scripts/plot/private/__print_parse_opts__.m
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/private/__print_parse_opts__.m	Thu Feb 23 22:13:06 2012 -0800
+++ b/scripts/plot/private/__print_parse_opts__.m	Fri Feb 24 07:57:50 2012 -0500
@@ -423,8 +423,17 @@
 %! assert (opts.figure, 5);
 
 function cmd = __quote_path__ (cmd)
-  if (any (cmd == " ") && ! (cmd(1) == """" && cmd(end) == """"))
-    cmd = strcat ("""", strrep (cmd, """", """"""), """");
+  if (! isempty (cmd))
+    is_quoted = all (cmd([1, end]) == "'");
+    if (! is_quoted)
+      dos_shell = ! isunix () && ispc ();
+      if (dos_shell && any (cmd == "/"))
+        cmd = strrep (cmd, "/", "\\");
+      endif
+      if (any (cmd == " "))
+        cmd = strcat ("""", strrep (cmd, """", """"""), """");
+      endif
+    endif
   endif
 endfunction