# HG changeset patch # User Markus Mützel # Date 1653564717 -7200 # Node ID 509ba2cc30ece0d93ef7266b982bf994f12bff26 # Parent f03e1eebf46d8a1c7e072e703e31908e2bd476d5# Parent 72786e15000147e794802cee791313f45d2a293b maint: Merge stable to default. diff -r f03e1eebf46d -r 509ba2cc30ec libinterp/corefcn/dirfns.cc --- a/libinterp/corefcn/dirfns.cc Wed May 25 17:58:13 2022 -0400 +++ b/libinterp/corefcn/dirfns.cc Thu May 26 13:31:57 2022 +0200 @@ -565,6 +565,15 @@ %! assert (result1, {"file1"; "myfile1"}); %! assert (result2, {"myfile1"}); %! assert (result3, {"file1"; "file2"}); + +## Check backslash handling on Windows +%!testif ; ispc () +%! win_dir = getenv ("WINDIR"); +%! assert (glob (win_dir), {win_dir}); +%! assert (glob ([win_dir, filesep]), {[win_dir, filesep]}); +%! win_dir2 = strrep(win_dir, filesep, '/'); +%! assert (glob (win_dir2), {win_dir}); +%! assert (glob ([win_dir2, '/']), {[win_dir, filesep]}); */ DEFUN (__wglob__, args, , diff -r f03e1eebf46d -r 509ba2cc30ec liboctave/util/oct-glob.cc --- a/liboctave/util/oct-glob.cc Wed May 25 17:58:13 2022 -0400 +++ b/liboctave/util/oct-glob.cc Thu May 26 13:31:57 2022 +0200 @@ -100,7 +100,7 @@ { #if (defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) \ && ! defined (OCTAVE_HAVE_POSIX_FILESYSTEM)) - std::replace (xpat.begin (), xpat.end (), '/', '\\'); + std::replace (xpat.begin (), xpat.end (), '\\', '/'); #endif int err = octave_glob_wrapper (xpat.c_str (),