# HG changeset patch # User Markus Mützel # Date 1650558753 -7200 # Node ID 230724ab29776e5c441b849b311b71f3f0804b06 # Parent 9d7ec294af2b1e9141d6e9618bb32aae9aa0a53c# Parent c09fdabaa5b6f79922d9b1c25dc8370be0ca2b52 maint: Merge stable to default. diff -r 9d7ec294af2b -r 230724ab2977 scripts/miscellaneous/dir.m --- a/scripts/miscellaneous/dir.m Thu Apr 21 17:54:21 2022 +0200 +++ b/scripts/miscellaneous/dir.m Thu Apr 21 18:32:33 2022 +0200 @@ -61,9 +61,13 @@ ## than a single directory or file. ## ## @var{directory} is subject to shell expansion if it contains any wildcard -## characters @samp{*}, @samp{?}, @samp{[]}. To find a literal example of a -## wildcard character the wildcard must be escaped using the backslash operator -## @samp{\}. +## characters @samp{*}, @samp{?}, @samp{[]}. If these wildcard characters are +## escaped with a backslash @samp{\} (e.g., @samp{\*}) on a POSIX platform, +## they aren't treated as wildcards but as the corresponding literal character. +## On Windows, it is not possible to escape wildcard characters because +## backslash @samp{\} is treated as a file separator. On Windows, use +## @code{ls} instead for file or folder names that contain characters that +## would be treated as wildcards by @code{dir}. ## ## Note that for symbolic links, @code{dir} returns information about the ## file that the symbolic link points to rather than the link itself. diff -r 9d7ec294af2b -r 230724ab2977 scripts/miscellaneous/ls.m --- a/scripts/miscellaneous/ls.m Thu Apr 21 17:54:21 2022 +0200 +++ b/scripts/miscellaneous/ls.m Thu Apr 21 18:32:33 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, '(?