# HG changeset patch # User Rik # Date 1407286255 25200 # Node ID 12d1297d3a380e34dca508dcb35fd06c455a17d4 # Parent 7141d9728ee022e831da1ba79a81b30d1d80de34 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. diff -r 7141d9728ee0 -r 12d1297d3a38 scripts/miscellaneous/ls.m --- 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