From a252566666f01e909c82344d0df94ea018940a09 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Thu, 2 Aug 2001 12:39:35 +0000 Subject: [PATCH] Fixed a minor bug in __getmainargs()/__GetMainArgs(). The parser for argc/argv inserts '\0'-characters in the buffer (CommandLineA). The next call to GetCommandLineA() returns only the first parameter (program name). svn path=/trunk/; revision=2137 --- reactos/lib/crtdll/misc/GetArgs.c | 1 + reactos/lib/msvcrt/misc/getargs.c | 1 + 2 files changed, 2 insertions(+) diff --git a/reactos/lib/crtdll/misc/GetArgs.c b/reactos/lib/crtdll/misc/GetArgs.c index 92f722b89c8..1b9a9d97f6e 100644 --- a/reactos/lib/crtdll/misc/GetArgs.c +++ b/reactos/lib/crtdll/misc/GetArgs.c @@ -94,6 +94,7 @@ int __GetMainArgs(int *argc,char ***argv,char ***env,int flag) __argc++; _acmdln_dll[i]='\0'; __argv[__argc-1] = strdup(_acmdln_dll + afterlastspace); + _acmdln_dll[i]=' '; i++; while (_acmdln_dll[i]==' ') i++; diff --git a/reactos/lib/msvcrt/misc/getargs.c b/reactos/lib/msvcrt/misc/getargs.c index f969bd152bf..27c059c48fc 100644 --- a/reactos/lib/msvcrt/misc/getargs.c +++ b/reactos/lib/msvcrt/misc/getargs.c @@ -33,6 +33,7 @@ int __getmainargs(int *argc,char ***argv,char ***env,int flag) __argc++; _acmdln[i]='\0'; __argv[__argc-1] = strdup(_acmdln + afterlastspace); + _acmdln[i]=' '; i++; while (_acmdln[i]==' ') i++;