Fix kiwix-mange problem with relative paths

This commit is contained in:
kelson42 2016-09-04 21:43:26 +02:00
parent 96f0fff54d
commit 2458c22e09

View File

@ -89,7 +89,9 @@ int main(int argc, char **argv) {
}
/* Try to read the file */
libraryPath = isRelativePath(libraryPath) ? computeAbsolutePath(removeLastPathElement(getExecutablePath(), true, false), libraryPath) : libraryPath;
libraryPath = isRelativePath(libraryPath) ?
computeAbsolutePath(getCurrentDirectory(), libraryPath) :
libraryPath;
libraryManager.readFile(libraryPath, false);
/* SHOW */
@ -201,8 +203,9 @@ int main(int argc, char **argv) {
}
/* Rewrite the library file */
if (action == REMOVE || action == ADD)
if (action == REMOVE || action == ADD) {
libraryManager.writeFile(libraryPath);
}
exit(0);
}