Skip to content

Commit

Permalink
Remove Sys_ParseCommandLine().
Browse files Browse the repository at this point in the history
Just use __argc/__argv directly. Fixes #313.
  • Loading branch information
skullernet committed Oct 9, 2023
1 parent 65061f5 commit a39dfe3
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions src/windows/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,43 +1201,6 @@ static int Sys_Main(int argc, char **argv)

#if USE_CLIENT

#define MAX_LINE_TOKENS 128

static char *sys_argv[MAX_LINE_TOKENS];
static int sys_argc;

/*
===============
Sys_ParseCommandLine
===============
*/
static void Sys_ParseCommandLine(char *line)
{
sys_argc = 1;
sys_argv[0] = APPLICATION;
while (*line) {
while (*line && *line <= 32) {
line++;
}
if (*line == 0) {
break;
}
sys_argv[sys_argc++] = line;
while (*line > 32) {
line++;
}
if (*line == 0) {
break;
}
*line = 0;
if (sys_argc == MAX_LINE_TOKENS) {
break;
}
line++;
}
}

/*
==================
WinMain
Expand All @@ -1253,9 +1216,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine

hGlobalInstance = hInstance;

Sys_ParseCommandLine(lpCmdLine);

return Sys_Main(sys_argc, sys_argv);
return Sys_Main(__argc, __argv);
}

#else // USE_CLIENT
Expand Down

0 comments on commit a39dfe3

Please sign in to comment.