Mercurial > octave-nkf
comparison src/variables.cc @ 5534:e107161b8ca3
[project @ 2005-11-11 17:44:05 by jwe]
author | jwe |
---|---|
date | Fri, 11 Nov 2005 17:45:51 +0000 |
parents | 2ff5363a16bd |
children | 2618a0750ae6 |
comparison
equal
deleted
inserted
replaced
5533:667ad2becb63 | 5534:e107161b8ca3 |
---|---|
1028 { | 1028 { |
1029 time_t tp = fcn->time_parsed (); | 1029 time_t tp = fcn->time_parsed (); |
1030 | 1030 |
1031 std::string nm = fcn->name (); | 1031 std::string nm = fcn->name (); |
1032 | 1032 |
1033 // XXX FIXME XXX -- the following code is repeated | |
1034 // in load_fcn_from_file in parse.y. | |
1035 | |
1033 string_vector names (2); | 1036 string_vector names (2); |
1034 | 1037 |
1035 names[0] = nm + ".oct"; | 1038 int nm_len = nm.length (); |
1036 names[1] = nm + ".m"; | 1039 |
1037 | 1040 std::string file; |
1038 std::string file = octave_env::make_absolute | 1041 |
1039 (Vload_path_dir_path.find_first_of (names), | 1042 if (octave_env::absolute_pathname (nm) |
1040 octave_env::getcwd ()); | 1043 && ((nm_len > 4 && nm.substr (nm_len-4) == ".oct") |
1044 || (nm_len > 2 && nm.substr (nm_len-4) == ".m"))) | |
1045 { | |
1046 file = nm; | |
1047 } | |
1048 else | |
1049 { | |
1050 file = lookup_autoload (nm); | |
1051 | |
1052 if (file.empty ()) | |
1053 { | |
1054 names[0] = nm + ".oct"; | |
1055 names[1] = nm + ".m"; | |
1056 | |
1057 file = octave_env::make_absolute | |
1058 (Vload_path_dir_path.find_first_of (names), | |
1059 octave_env::getcwd ()); | |
1060 } | |
1061 } | |
1041 | 1062 |
1042 if (same_file (file, ff)) | 1063 if (same_file (file, ff)) |
1043 { | 1064 { |
1044 retval = fcn_out_of_date (fcn, ff, tp); | 1065 retval = fcn_out_of_date (fcn, ff, tp); |
1045 } | 1066 } |