From a39dfe3793ddd0b658bd704980a56a3cf8ad18f4 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Mon, 9 Oct 2023 18:42:08 +0300 Subject: [PATCH] Remove Sys_ParseCommandLine(). Just use __argc/__argv directly. Fixes #313. --- src/windows/system.c | 41 +---------------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-) diff --git a/src/windows/system.c b/src/windows/system.c index 3a329e3e2..e967b719f 100644 --- a/src/windows/system.c +++ b/src/windows/system.c @@ -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 @@ -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