changeset 29093:1c212b36a35e

Use "__wglob__" instead of "glob" on Windows (bug #59287). * copyfile.m, fileattrib.m, movefile.m, unpack.m, pkg/private/rebuild.m: On Windows, gnulib's "glob" replacement doesn't work with non-ASCII characters in the file path or name. Use "__wglob__" instead on that platform.
author Markus Mützel <markus.muetzel@gmx.de>
date Mon, 23 Nov 2020 17:33:56 +0100
parents 38e22065d9ec
children d09dde091073
files scripts/miscellaneous/copyfile.m scripts/miscellaneous/fileattrib.m scripts/miscellaneous/movefile.m scripts/miscellaneous/unpack.m scripts/pkg/private/rebuild.m
diffstat 5 files changed, 25 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/copyfile.m	Mon Nov 23 16:11:46 2020 +0900
+++ b/scripts/miscellaneous/copyfile.m	Mon Nov 23 17:33:56 2020 +0100
@@ -98,7 +98,11 @@
   endif
 
   ## Protect the filename(s).
-  f1 = glob (f1);
+  if (ispc ())
+    f1 = __wglob__ (f1);
+  else
+    f1 = glob (f1);
+  endif
   if (isempty (f1))
     if (nargout == 0)
       error ("copyfile: no files to move");
--- a/scripts/miscellaneous/fileattrib.m	Mon Nov 23 16:11:46 2020 +0900
+++ b/scripts/miscellaneous/fileattrib.m	Mon Nov 23 17:33:56 2020 +0100
@@ -93,7 +93,11 @@
   msg = "";
   msgid = "";
 
-  files = glob (file);
+  if (ispc ())
+    files = __wglob__ (file);
+  else
+    files = glob (file);
+  endif
   if (isempty (files))
     files = {file};
   endif
--- a/scripts/miscellaneous/movefile.m	Mon Nov 23 16:11:46 2020 +0900
+++ b/scripts/miscellaneous/movefile.m	Mon Nov 23 17:33:56 2020 +0100
@@ -107,7 +107,11 @@
   endif
 
   ## Protect the filename(s).
-  f1 = glob (f1);
+  if (ispc ())
+    f1 = __wglob__ (f1);
+  else
+    f1 = glob (f1);
+  endif
   if (isempty (f1))
     if (nargout == 0)
       error ("movefile: no files to move");
--- a/scripts/miscellaneous/unpack.m	Mon Nov 23 16:11:46 2020 +0900
+++ b/scripts/miscellaneous/unpack.m	Mon Nov 23 17:33:56 2020 +0100
@@ -93,7 +93,11 @@
   if (numel (file) == 1)
     ## FIXME: The code below is not a perfect test for a URL
     if (isempty (strfind (file{1}, "://")))
-      gfile = glob (file);
+      if (ispc ())
+        gfile = __wglob__ (file);
+      else
+        gfile = glob (file);
+      endif
       if (isempty (gfile))
         error ('unpack: FILE "%s" not found', file{1});
       else
--- a/scripts/pkg/private/rebuild.m	Mon Nov 23 16:11:46 2020 +0900
+++ b/scripts/pkg/private/rebuild.m	Mon Nov 23 17:33:56 2020 +0100
@@ -46,7 +46,11 @@
     wd = pwd ();
     unwind_protect
       cd (prefix);
-      dirlist = glob (strcat (files, '-*'));
+      if (ispc ())
+        dirlist = __wglob__ (strcat (files, '-*'));
+      else
+        dirlist = glob (strcat (files, '-*'));
+      endif
     unwind_protect_cleanup
       cd (wd);
     end_unwind_protect