From f79e1b6d87c0c0347c47d7dfce3e8fe47198d476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 7 Jan 2014 20:47:04 +0100 Subject: [PATCH] Fixed #5317 (failed to load std.cfg) --- cli/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cli/main.cpp b/cli/main.cpp index c63fb3234..543d8628d 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -94,6 +94,10 @@ void CheckOther::checkZeroDivision() #include "cppcheckexecutor.h" +#ifdef _WIN32 +#include +#endif + /** * Main function of cppcheck * @@ -104,6 +108,11 @@ void CheckOther::checkZeroDivision() int main(int argc, char* argv[]) { CppCheckExecutor exec; +#ifdef _WIN32 + char exename[1024] = {0}; + GetModuleFileNameA(NULL, exename, sizeof(exename)/sizeof(exename[0])-1); + argv[0] = exename; +#endif return exec.check(argc, argv); }