diff --git a/src/common/basic-setup.cpp b/src/common/basic-setup.cpp index 030d76623..5ab319d0d 100644 --- a/src/common/basic-setup.cpp +++ b/src/common/basic-setup.cpp @@ -53,9 +53,8 @@ namespace lumiera { string resolve (fsys::path iniSpec) { - string file = iniSpec.leaf(); - string searchpath = iniSpec.branch_path().string(); - return resolveModulePath (file, searchpath); + string searchpath = iniSpec.parent_path().string(); ///////////TICKET #896 + return resolveModulePath (iniSpec.filename(), searchpath); } }//(End) implementation details diff --git a/src/lib/searchpath.cpp b/src/lib/searchpath.cpp index 4e4411ec3..86dccb015 100644 --- a/src/lib/searchpath.cpp +++ b/src/lib/searchpath.cpp @@ -71,7 +71,7 @@ namespace lib { { static const regex PICK_ORIGIN_TOKEN ("\\$?ORIGIN/?"); static const string expandedOriginDir - = fsys::path (findExePath()).remove_leaf().directory_string(); + = fsys::path (findExePath()).parent_path().string() + "/"; ///////////TICKET #896 return boost::regex_replace(src, PICK_ORIGIN_TOKEN, expandedOriginDir); } @@ -81,24 +81,24 @@ namespace lib { string - resolveModulePath (string moduleName, string searchPath) + resolveModulePath (fsys::path moduleName, string searchPath) { fsys::path modulePathName (moduleName); - SearchPathSplitter searchLocation(searchPath); + SearchPathSplitter searchLocation(searchPath); ///////////TICKET #896 while (true) { if (fsys::exists (modulePathName)) { INFO (config, "found module %s", modulePathName.string().c_str()); - return modulePathName.string(); + return modulePathName.string(); ///////////TICKET #896 } // try / continue search path if (searchLocation.isValid()) modulePathName = fsys::path() / searchLocation.next() / moduleName; else - throw error::Config ("Module \""+moduleName+"\" not found" + throw error::Config ("Module \""+moduleName.string()+"\" not found" /////TICKET #896 + (searchPath.empty()? ".":" in search path: "+searchPath)); } } diff --git a/src/lib/searchpath.hpp b/src/lib/searchpath.hpp index 66b985a5d..3505b9b69 100644 --- a/src/lib/searchpath.hpp +++ b/src/lib/searchpath.hpp @@ -111,7 +111,7 @@ namespace lib { * @return the absolute pathname of the module file found * @throws error::Config when the resolution fails */ - string resolveModulePath (string moduleName, string searchPath = ""); + string resolveModulePath (fsys::path moduleName, string searchPath = "");