Mercurial > hg > octave-lyh
diff scripts/plot/private/__print_parse_opts__.m @ 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 | b76f0740940e |
children | b06010f12183 |
line wrap: on
line diff
--- a/scripts/plot/private/__print_parse_opts__.m +++ b/scripts/plot/private/__print_parse_opts__.m @@ -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