comparison scripts/miscellaneous/ls.m @ 18063:1e9cb13faa7a

ls.m: Strip tailing UNIX file separator when running in Windows environment (bug #40726). * ls.m: Strip tailing UNIX file separator when running in Windows environment (bug #40726).
author Rik <rik@octave.org>
date Tue, 03 Dec 2013 13:13:44 -0800
parents 7df8f5372ea8
children 05a53cc522b7 0b657f4e7780
comparison
equal deleted inserted replaced
18061:832ecfda1d3c 18063:1e9cb13faa7a
61 if (nargin > 0) 61 if (nargin > 0)
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 ## Strip UNIX directory character which looks like an option to dir cmd.
67 if (args{end}(end) == '/')
68 args{end}(end) = "";
69 endif
66 else 70 else
67 args = regexprep (args, '([^\w.*? -])', '\\$1'); 71 args = regexprep (args, '([^\w.*? -])', '\\$1');
68 endif 72 endif
69 args = sprintf ("%s ", args{:}); 73 args = sprintf ("%s ", args{:});
70 else 74 else