Don't use the cmd paramter passed by WinMain.

It doesn't include the argv[0], 💩.
This commit is contained in:
Cheng Zhao 2013-08-31 15:42:41 +08:00
parent e7d4b44d05
commit a5bc2fdb44

View file

@ -21,7 +21,7 @@ int Start(int argc, char *argv[]);
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
int argc = 0;
wchar_t** wargv = ::CommandLineToArgvW(cmd, &argc);
wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
if (argc > 1 && wcscmp(wargv[1], L"--atom-child_process-fork") == 0) {
// Convert argv to to UTF8
char** argv = new char*[argc];