Mercurial > octave
diff libinterp/corefcn/variables.cc @ 23438:d24d01273bd0
eliminate load-path singleton
* load-path.h, load-path.cc (class load_path): Don't use singleton
idiom.
* interpreter-private.h, interpreter-private.cc: New files.
* interpreter.cc, interpreter.h (interpreter::m_load_path):
New data member. Manage initialization of load_path in interpreter
class.
(interpreter::get_load_path): New method.
Change all uses of static load_path methods to use global load_path
object instead.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Apr 2017 00:20:59 -0400 |
parents | 7d4ca8c01bbb |
children | 8e310ef0fa97 |
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc Tue Apr 25 14:20:34 2017 -0400 +++ b/libinterp/corefcn/variables.cc Thu Apr 20 00:20:59 2017 -0400 @@ -48,6 +48,7 @@ #include "errwarn.h" #include "help.h" #include "input.h" +#include "interpreter-private.h" #include "interpreter.h" #include "lex.h" #include "load-path.h" @@ -426,7 +427,11 @@ std::string file_name = octave::lookup_autoload (name); if (file_name.empty ()) - file_name = load_path::find_fcn (name); + { + load_path& lp = octave::__get_load_path__ ("symbol_exist"); + + file_name = lp.find_fcn (name); + } size_t len = file_name.length ();