From fa9b027a39bb0e60a805b2535fd3b256bba38918 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 13 Nov 2017 11:52:40 +0100 Subject: [PATCH] Relative paths are relative to current directory not executable. Almost nothing should be relative to the executable directory. Content coming from the user should be relative to where the user is (its working directory). Fixes #70. --- src/server/kiwix-serve.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/server/kiwix-serve.cpp b/src/server/kiwix-serve.cpp index a03e5fe..bd57154 100644 --- a/src/server/kiwix-serve.cpp +++ b/src/server/kiwix-serve.cpp @@ -920,9 +920,7 @@ int main(int argc, char** argv) try { string libraryPath = isRelativePath(*itr) - ? computeAbsolutePath(removeLastPathElement( - getExecutablePath(), true, false), - *itr) + ? computeAbsolutePath(getCurrentDirectory(), *itr) : *itr; retVal = libraryManager.readFile(libraryPath, true); } catch (...) {