# HG changeset patch # User Markus Mützel # Date 1655316134 -7200 # Wed Jun 15 20:02:14 2022 +0200 # Node ID b5857b5de27252af44df2fe342e842a0ca84f3f5 # Parent b6aeea9495317f413061bbc31d24f140fb38c6ab WIP: dir.m (bug #62589) diff -r b6aeea949531 -r b5857b5de272 scripts/miscellaneous/dir.m --- a/scripts/miscellaneous/dir.m Wed Jun 15 20:00:35 2022 +0200 +++ b/scripts/miscellaneous/dir.m Wed Jun 15 20:02:14 2022 +0200 @@ -99,7 +99,8 @@ else flst = __wglob__ (directory); nf = numel (flst); - dir_has_wildcard = any (directory == '*'); # See Bug #58976. + dir_has_wildcard = any (directory == '*') ... # See bug #58976. + && ! any (strcmp (directory (end), filesep ("all"))); endif ## Determine the file list for the case where a single directory is specified. @@ -279,6 +280,15 @@ %! endif %! end_unwind_protect +%!test <*62589> +%! orig_dir = cd (fullfile (fileparts (which ("plot")), "..")); +%! unwind_protect +%! assert (numel (dir ("dr*")), 1); +%! assert (numel (dir ("dr*/")) > 1); +%! unwind_protect_cleanup +%! cd (orig_dir); +%! end_unwind_protect + ## Test input validation %!error dir (1) %!warning dir ("_%UNLIKELY_DIR_NAME%_");