comparison scripts/miscellaneous/ls.m @ 15700:5d6a5bc65ef1

Fix regexp escaping of arguments to ls * scripts/miscellaneous/ls.m: Fix regexp escaping of arguments to ls.
author Mike Miller <mtmiller@ieee.org>
date Thu, 29 Nov 2012 23:10:51 -0500
parents f3d52523cde1
children 6b00c6bff60c
comparison
equal deleted inserted replaced
15699:13d9c90b9cf8 15700:5d6a5bc65ef1
54 args = tilde_expand (varargin); 54 args = tilde_expand (varargin);
55 if (ispc () && ! isunix ()) 55 if (ispc () && ! isunix ())
56 ## shell (cmd.exe) on MinGW uses '^' as escape character 56 ## shell (cmd.exe) on MinGW uses '^' as escape character
57 args = regexprep (args, '([^\w.*? -])', '^$1'); 57 args = regexprep (args, '([^\w.*? -])', '^$1');
58 else 58 else
59 args = regexprep (args, '([^\w.*? -])', '\$1'); 59 args = regexprep (args, '([^\w.*? -])', '\\$1');
60 endif 60 endif
61 args = sprintf ("%s ", args{:}); 61 args = sprintf ("%s ", args{:});
62 else 62 else
63 args = ""; 63 args = "";
64 endif 64 endif