changeset 30951:6397b6d7c42e stable

ls.m: On Windows also exclude escaped wildcards from quoted part of string (bug #62282).
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 21 Apr 2022 18:30:25 +0200
parents 7d99816e9709
children c09fdabaa5b6
files scripts/miscellaneous/ls.m
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/ls.m	Thu Apr 21 17:52:31 2022 +0200
+++ b/scripts/miscellaneous/ls.m	Thu Apr 21 18:30:25 2022 +0200
@@ -76,10 +76,12 @@
         args = regexprep (args, '\\(?![\*\?\[\]])', '/');
         ## Enclose paths, potentially having spaces, in double quotes:
         args = strcat ('"', args, '"');
-        ## Exclude glob patterns from quoted part of FILENAMES string
+        ## Exclude glob patterns and escaped characters from quoted part of
+        ## FILENAMES string
         args = regexprep (args, '(?<!\\)([\*\?])', '"$1"');
         args = regexprep (args, '(?<!\\)\[', '"[');
         args = regexprep (args, '(?<!\\)\[', ']"');
+        args = regexprep (args, '(\\.)', '"$1"');
       else
         idx = ! strncmp (args, '/', 1);
         ## Enclose paths, potentially having spaces, in double quotes: