comparison scripts/miscellaneous/ls.m @ 19022:12d1297d3a38

ls.m: Fix bug listing directories with spaces in name (bug #42920) * ls.m: Order brackets first within character class so that PCRE recognizes them rather than believing they end the character class.
author Rik <rik@octave.org>
date Tue, 05 Aug 2014 17:50:55 -0700
parents 3d22b24863b9
children b517b08d2e24
comparison
equal deleted inserted replaced
19020:7141d9728ee0 19022:12d1297d3a38
66 args(idx) = strcat ('"', args(idx), '"'); 66 args(idx) = strcat ('"', args(idx), '"');
67 ## shell (cmd.exe) on MinGW uses '^' as escape character 67 ## shell (cmd.exe) on MinGW uses '^' as escape character
68 args = regexprep (args, '([^\w.*?])', '^$1'); 68 args = regexprep (args, '([^\w.*?])', '^$1');
69 else 69 else
70 ## Escape any special characters in filename 70 ## Escape any special characters in filename
71 args = regexprep (args, '([^\w.*?-[]])', '\\$1'); 71 args = regexprep (args, '([^][\w.*?-])', '\\$1');
72 endif 72 endif
73 args = sprintf ("%s ", args{:}); 73 args = sprintf ("%s ", args{:});
74 else 74 else
75 args = ""; 75 args = "";
76 endif 76 endif