mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-20 18:01:16 +00:00
Let "+" command line parameters specify more than one argument
Previously each parameter after the first would be quoted into one argument to pass to the command buffer.
This commit is contained in:
parent
b38921ff53
commit
ffc274643c
1 changed files with 3 additions and 18 deletions
21
src/m_argv.c
21
src/m_argv.c
|
@ -92,36 +92,21 @@ const char *M_GetNextParm(void)
|
|||
void M_PushSpecialParameters(void)
|
||||
{
|
||||
INT32 i;
|
||||
char s[256];
|
||||
boolean onetime = false;
|
||||
|
||||
for (i = 1; i < myargc; i++)
|
||||
{
|
||||
if (myargv[i][0] == '+')
|
||||
{
|
||||
strcpy(s, &myargv[i][1]);
|
||||
COM_BufAddText(&myargv[i][1]);
|
||||
i++;
|
||||
|
||||
// get the parameters of the command too
|
||||
for (; i < myargc && myargv[i][0] != '+' && myargv[i][0] != '-'; i++)
|
||||
{
|
||||
strcat(s, " ");
|
||||
if (!onetime)
|
||||
{
|
||||
strcat(s, "\"");
|
||||
onetime = true;
|
||||
}
|
||||
strcat(s, myargv[i]);
|
||||
COM_BufAddText(va(" \"%s\"", myargv[i]));
|
||||
}
|
||||
if (onetime)
|
||||
{
|
||||
strcat(s, "\"");
|
||||
onetime = false;
|
||||
}
|
||||
strcat(s, "\n");
|
||||
|
||||
// push it
|
||||
COM_BufAddText(s);
|
||||
COM_BufAddText("\n");
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue