diff scripts/miscellaneous/ls.m @ 18988: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
line wrap: on
line diff
--- a/scripts/miscellaneous/ls.m	Wed Aug 06 01:11:58 2014 +0100
+++ b/scripts/miscellaneous/ls.m	Tue Aug 05 17:50:55 2014 -0700
@@ -68,7 +68,7 @@
       args = regexprep (args, '([^\w.*?])', '^$1');
     else
       ## Escape any special characters in filename
-      args = regexprep (args, '([^\w.*?-[]])', '\\$1');
+      args = regexprep (args, '([^][\w.*?-])', '\\$1');
     endif
     args = sprintf ("%s ", args{:});
   else