From 9ec15ba8914a7584e3dce64b8174f964b6e76651 Mon Sep 17 00:00:00 2001 From: kelson42 Date: Thu, 29 May 2014 22:38:02 +0200 Subject: [PATCH] + code more clean --- src/launcher/kiwix-launcher.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/launcher/kiwix-launcher.cpp b/src/launcher/kiwix-launcher.cpp index 3ac4a04..c5f9cb6 100644 --- a/src/launcher/kiwix-launcher.cpp +++ b/src/launcher/kiwix-launcher.cpp @@ -23,9 +23,11 @@ #pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" ) #include #include +#define EXEXT ".exe" #define EXECL _execl #define PUTENV _putenv #else +#define EXEXT "" #include #include #define EXECL execl @@ -100,18 +102,9 @@ int main(int argc, char *argv[]) { directoriesIt = xulrunnerPossibleDirectories.begin(); while (xulrunnerPath.empty() && directoriesIt != xulrunnerPossibleDirectories.end()) { if (fileExists(*directoriesIt)) { -#ifdef _WIN32 - xulrunnerPath = computeAbsolutePath(*directoriesIt, "xulrunner-bin.exe"); -#else - xulrunnerPath = computeAbsolutePath(*directoriesIt, "xulrunner-bin"); -#endif - + xulrunnerPath = computeAbsolutePath(*directoriesIt, std::string("xulrunner-bin") + std::string(EXEXT)); if (!fileExists(xulrunnerPath)) { -#ifdef _WIN32 - xulrunnerPath = computeAbsolutePath(*directoriesIt, "xulrunner.exe"); -#else - xulrunnerPath = computeAbsolutePath(*directoriesIt, "xulrunner"); -#endif + xulrunnerPath = computeAbsolutePath(*directoriesIt, std::string("xulrunner") + std::string(EXEXT)); if (!fileExists(xulrunnerPath)) { xulrunnerPath.clear(); }