Mercurial > hg > octave-nkf
diff src/variables.cc @ 5140:550b12564a74
[project @ 2005-02-10 15:12:37 by jwe]
author | jwe |
---|---|
date | Thu, 10 Feb 2005 15:12:37 +0000 |
parents | 5fa9670b5956 |
children | 4c8a2e4e0717 |
line wrap: on
line diff
--- 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; + } } } }