comparison liboctave/util/cmd-edit.cc @ 32078:632f9b828de1

Avoid using file_stat in liboctave/util (bug #59711). * cmd-edit.cc (looks_like_filename), cmd-hist.cc (gnu_history::do_append), kpse.cc (kpse_element_dir), oct-glob.cc (glob, windows_glob), url-transfer.cc (base_url_transfer::mget_directory): Use functions "dir_exists" or "file_exists" instead of "file_stat". * kpse.cc (dir_p), oct-glob.cc (single_match_exists): Remove unused static functions.
author Markus Mützel <markus.muetzel@gmx.de>
date Sat, 06 May 2023 10:56:33 +0200
parents 1daf8bfceac3
children ae4e19c0a2b1 2e484f9f1f18
comparison
equal deleted inserted replaced
32077:ed3a18fe328a 32078:632f9b828de1
35 #include "cmd-edit.h" 35 #include "cmd-edit.h"
36 #include "cmd-hist.h" 36 #include "cmd-hist.h"
37 #include "file-ops.h" 37 #include "file-ops.h"
38 #include "file-stat.h" 38 #include "file-stat.h"
39 #include "lo-error.h" 39 #include "lo-error.h"
40 #include "lo-sysdep.h"
40 #include "lo-utils.h" 41 #include "lo-utils.h"
41 #include "oct-env.h" 42 #include "oct-env.h"
42 #include "oct-mutex.h" 43 #include "oct-mutex.h"
43 #include "oct-time.h" 44 #include "oct-time.h"
44 #include "quit.h" 45 #include "quit.h"
548 549
549 if (candidate_filename[0] == '~') 550 if (candidate_filename[0] == '~')
550 candidate_filename 551 candidate_filename
551 = sys::file_ops::tilde_expand (candidate_filename); 552 = sys::file_ops::tilde_expand (candidate_filename);
552 553
553 sys::file_stat fs (candidate_filename); 554 retval = sys::dir_exists (candidate_filename);
554
555 retval = fs.is_dir ();
556 } 555 }
557 } 556 }
558 557
559 return retval; 558 return retval;
560 } 559 }