# HG changeset patch # User jwe # Date 1108048357 0 # Node ID 550b12564a741e72c102daeb8fd69191e41576f5 # Parent f2858bbf0277b8f1315442cdd57cef36327bfa26 [project @ 2005-02-10 15:12:37 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-02-10 John W. Eaton + + * variables.cc (symbol_exist): Don't search path if explicitly + asked for a variable or builtin. From David Bateman + . + 2005-02-09 John W. Eaton * variables.cc (same_file): New static function. diff --git a/src/variables.cc b/src/variables.cc --- a/src/variables.cc +++ b/src/variables.cc @@ -823,49 +823,52 @@ } } - if (! retval) + if (! (type == "var" || type == "builtin")) { - string_vector names (2); - - names(0) = name + ".oct"; - names(1) = name + ".m"; - - std::string file_name = Vload_path_dir_path.find_first_of (names); - - size_t len = file_name.length (); - - if (! file_name.empty ()) + if (! retval) { - if (type == "any" || type == "file") + string_vector names (2); + + names(0) = name + ".oct"; + names(1) = name + ".m"; + + std::string file_name = Vload_path_dir_path.find_first_of (names); + + size_t len = file_name.length (); + + if (! file_name.empty ()) { - if (file_name.substr (len-4) == ".oct") - retval = 3; - else - retval = 2; + if (type == "any" || type == "file") + { + if (file_name.substr (len-4) == ".oct") + retval = 3; + else + retval = 2; + } } } - } - - if (! retval) - { - std::string file_name = file_in_path (name, ""); - - if (file_name.empty ()) - file_name = name; - - file_stat fs (file_name); - - if (fs) + + if (! retval) { - if ((type == "any" || type == "file") - && fs.is_reg ()) + std::string file_name = file_in_path (name, ""); + + if (file_name.empty ()) + file_name = name; + + file_stat fs (file_name); + + if (fs) { - retval = 2; - } - else if ((type == "any" || type == "dir") - && fs.is_dir ()) - { - retval = 7; + if ((type == "any" || type == "file") + && fs.is_reg ()) + { + retval = 2; + } + else if ((type == "any" || type == "dir") + && fs.is_dir ()) + { + retval = 7; + } } } }