# 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 --git a/scripts/miscellaneous/ls.m b/scripts/miscellaneous/ls.m --- a/scripts/miscellaneous/ls.m +++ b/scripts/miscellaneous/ls.m @@ -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