comparison libinterp/corefcn/load-path.cc @ 20262:8b501a0db1e9

only insert package names into loader map if package dir exists (bug #43769) * load-path.h, load-path.cc (load_path::::is_package): New function. (load_path::dir_info::is_package): New function. (load_path::get_loader): Don't insert name into loader map unless is it is also a +package directory somewhere in the load path. * ov-classdef.cc (cdef_manager::do_find_package_symbol): Undo change from changeset 8fe29850fb74.
author John W. Eaton <jwe@octave.org>
date Thu, 02 Apr 2015 17:16:03 -0400
parents 19755f4fc851
children a8769ccb2c4e
comparison
equal deleted inserted replaced
20261:10600b2dd3c1 20262:8b501a0db1e9
105 else 105 else
106 { 106 {
107 std::string msg = fs.error (); 107 std::string msg = fs.error ();
108 warning ("load_path: %s: %s", dir_name.c_str (), msg.c_str ()); 108 warning ("load_path: %s: %s", dir_name.c_str (), msg.c_str ());
109 } 109 }
110 }
111
112 bool
113 load_path::dir_info::is_package (const std::string& name) const
114 {
115 return package_dir_map.find (name) != package_dir_map.end ();
110 } 116 }
111 117
112 void 118 void
113 load_path::dir_info::initialize (void) 119 load_path::dir_info::initialize (void)
114 { 120 {
1214 1220
1215 if (! retval.empty ()) 1221 if (! retval.empty ())
1216 retval.sort (); 1222 retval.sort ();
1217 1223
1218 return retval; 1224 return retval;
1225 }
1226
1227 bool
1228 load_path::is_package (const std::string& name) const
1229 {
1230 for (const_dir_info_list_iterator p = dir_info_list.begin ();
1231 p != dir_info_list.end ();
1232 p++)
1233 {
1234 if (p->is_package (name))
1235 return true;
1236 }
1237
1238 return false;
1219 } 1239 }
1220 1240
1221 std::list<std::string> 1241 std::list<std::string>
1222 load_path::do_overloads (const std::string& meth) const 1242 load_path::do_overloads (const std::string& meth) const
1223 { 1243 {