From 9f9d5d4b157f6f992edcb5f8c20056915c7dcd7b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 26 Jul 2015 07:29:02 +0200 Subject: main: simplify win32 add_program_library_path --- facetracknoir/main.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp index 326b40ec..7ba0a462 100644 --- a/facetracknoir/main.cpp +++ b/facetracknoir/main.cpp @@ -17,18 +17,14 @@ using namespace options; // workaround QTBUG-38598, allow for launching from another directory static void add_program_library_path() { + char* p = _pgmptr; + char path[MAX_PATH+1]; + strcpy(path, p); + char* ptr = strrchr(path, '\\'); + if (ptr) { - char* p = _pgmptr; - { - char path[MAX_PATH+1]; - strcpy(path, p); - char* ptr = strrchr(path, '\\'); - if (ptr) - { - *ptr = '\0'; - QCoreApplication::addLibraryPath(path); - } - } + *ptr = '\0'; + QCoreApplication::addLibraryPath(path); } } #endif -- cgit v1.2.3