Mercurial > octave-dspies
comparison scripts/miscellaneous/ls.m @ 18987:082063dc2165 stable
ls.m: Fix bug listing directories with spaces in name (bug #42920).
* ls.m: Escape spaces in directory names before passing to system command.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 05 Aug 2014 17:46:31 -0700 |
parents | 7df8f5372ea8 |
children | 0b657f4e7780 |
comparison
equal
deleted
inserted
replaced
18984:1197f04eec09 | 18987:082063dc2165 |
---|---|
62 args = tilde_expand (varargin); | 62 args = tilde_expand (varargin); |
63 if (ispc () && ! isunix ()) | 63 if (ispc () && ! isunix ()) |
64 ## shell (cmd.exe) on MinGW uses '^' as escape character | 64 ## shell (cmd.exe) on MinGW uses '^' as escape character |
65 args = regexprep (args, '([^\w.*? -])', '^$1'); | 65 args = regexprep (args, '([^\w.*? -])', '^$1'); |
66 else | 66 else |
67 args = regexprep (args, '([^\w.*? -])', '\\$1'); | 67 args = regexprep (args, '([^\w.*?-])', '\\$1'); |
68 endif | 68 endif |
69 args = sprintf ("%s ", args{:}); | 69 args = sprintf ("%s ", args{:}); |
70 else | 70 else |
71 args = ""; | 71 args = ""; |
72 endif | 72 endif |