+ fix kiwix-mange and kiwix-serve to be able to deal with relative library paths

This commit is contained in:
kelson42 2014-08-09 21:41:08 +02:00
parent f8628c9fe4
commit a9d1e672f0
2 changed files with 4 additions and 1 deletions

View File

@ -86,6 +86,7 @@ int main(int argc, char **argv) {
}
/* Try to read the file */
libraryPath = isRelativePath(libraryPath) ? computeAbsolutePath(removeLastPathElement(getExecutablePath(), true, false), libraryPath) : libraryPath;
libraryManager.readFile(libraryPath, false);
/* SHOW */

View File

@ -566,8 +566,10 @@ int main(int argc, char **argv) {
for ( itr = libraryPaths.begin(); itr != libraryPaths.end(); ++itr ) {
if (!(*itr).empty()) {
bool retVal = false;
string libraryPath = isRelativePath(*itr) ? computeAbsolutePath(removeLastPathElement(getExecutablePath(), true, false), *itr) : *itr;
try {
retVal = libraryManager.readFile(*itr, true);
retVal = libraryManager.readFile(libraryPath, true);
} catch (...) {
retVal = false;
}