Mercurial > hg > octave-lojdl
changeset 15743:5238ff93777d
Correctly locate octave.jar in VPATH builds (bug #37815)
* libinterp/dldfcn/__java__.cc(get_module_path): Fix function. Use Octave
coding conventions.
* libinterp/dldfcn/__java__.cc(initial_class_path): Use get_module_path to find
octave.jar.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 06 Dec 2012 22:24:36 -0800 |
parents | ac0964f482ae |
children | 686580b1a934 |
files | libinterp/dldfcn/__java__.cc |
diffstat | 1 files changed, 14 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/dldfcn/__java__.cc +++ b/libinterp/dldfcn/__java__.cc @@ -226,28 +226,31 @@ } #endif -static std::string get_module_path(const std::string& name, bool strip_name = true) +static std::string get_module_path (const std::string& name, bool strip_name = true) { std::string retval; retval = octave_env::make_absolute (load_path::find_file (name), #ifdef HAVE_OCTAVE_32 - octave_env::getcwd ()); + octave_env::getcwd ()); #else - octave_env::get_current_directory ()); + octave_env::get_current_directory ()); #endif - if (! retval.empty () && strip_name) + if (! retval.empty ()) { - size_t pos = retval.rfind (file_ops::dir_sep_str () + name); + if (strip_name) + { + size_t pos = retval.rfind (file_ops::dir_sep_str () + name); - if (pos != std::string::npos) - retval.resize (pos); - else - throw std::string("No module path in ")+retval; + if (pos != std::string::npos) + retval.resize (pos); + else + throw std::string ("No module path in ") + retval; + } } else - throw std::string("Could not find file ")+name; + throw std::string ("Could not find file ") + name; return retval; } @@ -329,7 +332,7 @@ // find octave.jar file if (! retval.empty ()) { - std::string jar_file = retval + file_ops::dir_sep_str () + "octave.jar"; + std::string jar_file = get_module_path ("octave.jar", false); file_stat jar_exists (jar_file); if (jar_exists)