Fixed #5317 (failed to load std.cfg)

This commit is contained in:
Daniel Marjamäki 2014-01-07 20:47:04 +01:00
parent 4f9b0f38aa
commit f79e1b6d87
1 changed files with 9 additions and 0 deletions

View File

@ -94,6 +94,10 @@ void CheckOther::checkZeroDivision()
#include "cppcheckexecutor.h" #include "cppcheckexecutor.h"
#ifdef _WIN32
#include <windows.h>
#endif
/** /**
* Main function of cppcheck * Main function of cppcheck
* *
@ -104,6 +108,11 @@ void CheckOther::checkZeroDivision()
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
CppCheckExecutor exec; 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); return exec.check(argc, argv);
} }