# HG changeset patch # User jwe # Date 1151686120 0 # Node ID b9fd54407c8d7d96049c505f2a3e9ad28f7a4bee # Parent a0218194daa68473e122fc0668b7e688c7f95480 [project @ 2006-06-30 16:48:39 by jwe] diff -r a0218194daa6 -r b9fd54407c8d liboctave/ChangeLog --- a/liboctave/ChangeLog Fri Jun 30 15:50:40 2006 +0000 +++ b/liboctave/ChangeLog Fri Jun 30 16:48:40 2006 +0000 @@ -1,5 +1,8 @@ 2006-06-30 John W. Eaton + * dir-ops.cc (dir_entry::open): Perform tilde expansion here. + * file-stat.cc (stat::update_internal): Ditto. + * data-conv.cc (data_conv::string_to_data_type): Correctly handle leading "*". diff -r a0218194daa6 -r b9fd54407c8d liboctave/dir-ops.cc --- a/liboctave/dir-ops.cc Fri Jun 30 15:50:40 2006 +0000 +++ b/liboctave/dir-ops.cc Fri Jun 30 16:48:40 2006 +0000 @@ -32,6 +32,7 @@ #include "sysdir.h" #include "dir-ops.h" +#include "file-ops.h" #include "lo-error.h" #include "lo-sysdep.h" #include "str-vec.h" @@ -47,8 +48,10 @@ if (! name.empty ()) { close (); + + std::string fullname = file_ops::tilde_expand (name); - dir = static_cast (opendir (name.c_str ())); + dir = static_cast (opendir (fullname.c_str ())); if (dir) fail = false; diff -r a0218194daa6 -r b9fd54407c8d liboctave/file-stat.cc --- a/liboctave/file-stat.cc Fri Jun 30 15:50:40 2006 +0000 +++ b/liboctave/file-stat.cc Fri Jun 30 16:48:40 2006 +0000 @@ -35,6 +35,7 @@ #include #endif +#include "file-ops.h" #include "file-stat.h" #include "statdefs.h" @@ -196,8 +197,10 @@ { initialized = false; fail = false; + + std::string full_file_name = file_ops::tilde_expand (file_name); - const char *cname = file_name.c_str (); + const char *cname = full_file_name.c_str (); struct stat buf; diff -r a0218194daa6 -r b9fd54407c8d src/ChangeLog --- a/src/ChangeLog Fri Jun 30 15:50:40 2006 +0000 +++ b/src/ChangeLog Fri Jun 30 16:48:40 2006 +0000 @@ -1,3 +1,8 @@ +2006-06-30 John W. Eaton + + * load-path.cc (genpath): Don't perform tilde expansion on name. + (load_path::do_add): Don't warn about moving "." to front of list. + 2006-06-28 John W. Eaton * load-path.cc (Faddpath): Don't treat "." specially here. diff -r a0218194daa6 -r b9fd54407c8d src/load-path.cc --- a/src/load-path.cc Fri Jun 30 15:50:40 2006 +0000 +++ b/src/load-path.cc Fri Jun 30 16:48:40 2006 +0000 @@ -509,12 +509,7 @@ i = find_dir_info ("."); if (i != dir_info_list.end ()) - { - if (i != dir_info_list.begin () && warn) - warning ("addpath: \".\" is always first in the path"); - - move (i, false); - } + move (i, false); else panic_impossible (); } @@ -1140,9 +1135,7 @@ { std::string retval; - std::string full_dirname = file_ops::tilde_expand (dirname); - - dir_entry dir (full_dirname); + dir_entry dir (dirname); if (dir) { @@ -1172,7 +1165,7 @@ if (! skip_p) { - std::string nm = full_dirname + file_ops::dir_sep_str + elt; + std::string nm = dirname + file_ops::dir_sep_str + elt; file_stat fs (nm);