Skip to content

Commit f79e1b6

Browse files
committed
Fixed cppcheck-opensource#5317 (failed to load std.cfg)
1 parent 4f9b0f3 commit f79e1b6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

cli/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ void CheckOther::checkZeroDivision()
9494

9595
#include "cppcheckexecutor.h"
9696

97+
#ifdef _WIN32
98+
#include <windows.h>
99+
#endif
100+
97101
/**
98102
* Main function of cppcheck
99103
*
@@ -104,6 +108,11 @@ void CheckOther::checkZeroDivision()
104108
int main(int argc, char* argv[])
105109
{
106110
CppCheckExecutor exec;
111+
#ifdef _WIN32
112+
char exename[1024] = {0};
113+
GetModuleFileNameA(NULL, exename, sizeof(exename)/sizeof(exename[0])-1);
114+
argv[0] = exename;
115+
#endif
107116
return exec.check(argc, argv);
108117
}
109118

0 commit comments

Comments
 (0)