Mercurial > octave
diff libinterp/corefcn/variables.cc @ 26843:f07542e3a9b9
Fix "exist" for drive letters and UNC shares on Windows (bug #55824).
* sysdep.[h,cc] (drive_or_unc_share): New function.
* variables.cc (symbol_exist): Use this function.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Tue, 05 Mar 2019 22:24:00 +0100 |
parents | 3e1f8934c4de |
children | 9b261300a001 |
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc Tue Mar 05 22:04:24 2019 +0100 +++ b/libinterp/corefcn/variables.cc Tue Mar 05 22:24:00 2019 +0100 @@ -63,6 +63,7 @@ #include "parse.h" #include "syminfo.h" #include "symtab.h" +#include "sysdep.h" #include "unwind-prot.h" #include "utils.h" #include "variables.h" @@ -270,6 +271,10 @@ if (file_name.empty ()) file_name = name; + // "stat" doesn't work on UNC shares and drive letters. + if ((search_any || search_file) && octave::drive_or_unc_share (file_name)) + return 7; + octave::sys::file_stat fs (file_name); if (fs)