changeset 20746:69aeef6736df

unpack.m: Restore ability for input to be a URL (bug #46504). * unpack.m: Check whether "filename" looks like a URL and don't use glob() on it if found.
author Rik <rik@octave.org>
date Tue, 24 Nov 2015 11:49:36 -0800
parents c4f79fc9281a
children ee2743bd07a8
files scripts/miscellaneous/unpack.m
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/miscellaneous/unpack.m	Tue Nov 24 11:10:16 2015 -0800
+++ b/scripts/miscellaneous/unpack.m	Tue Nov 24 11:49:36 2015 -0800
@@ -86,11 +86,14 @@
     file = cellstr (file);
   endif
   if (numel (file) == 1)
-    gfile = glob (file);
-    if (isempty (gfile))
-      error ('unpack: file "%s" not found', file{1});
-    else
-      file = gfile;
+    if (isempty (strfind (file, "://")))
+      ## FIXME: The above code is not a perfect test for a URL
+      gfile = glob (file);
+      if (isempty (gfile))
+        error ('unpack: file "%s" not found', file{1});
+      else
+        file = gfile;
+      endif
     endif
   endif