Mercurial > hg > octave-nkf
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 +++ 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