diff libinterp/corefcn/load-path.cc @ 20087: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
line wrap: on
line diff
--- a/libinterp/corefcn/load-path.cc	Wed Apr 08 16:46:10 2015 -0400
+++ b/libinterp/corefcn/load-path.cc	Thu Apr 02 17:16:03 2015 -0400
@@ -109,6 +109,12 @@
     }
 }
 
+bool
+load_path::dir_info::is_package (const std::string& name) const
+{
+  return package_dir_map.find (name) != package_dir_map.end ();
+}
+
 void
 load_path::dir_info::initialize (void)
 {
@@ -1218,6 +1224,20 @@
   return retval;
 }
 
+bool
+load_path::is_package (const std::string& name) const
+{
+  for (const_dir_info_list_iterator p = dir_info_list.begin ();
+       p != dir_info_list.end ();
+       p++)
+    {
+      if (p->is_package (name))
+        return true;
+    }
+
+  return false;
+}
+
 std::list<std::string>
 load_path::do_overloads (const std::string& meth) const
 {