Skip to content
Snippets Groups Projects
Commit ffc27464 authored by James R.'s avatar James R.
Browse files

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.
parent b38921ff
Branches
Tags
No related merge requests found
...@@ -92,36 +92,21 @@ const char *M_GetNextParm(void) ...@@ -92,36 +92,21 @@ const char *M_GetNextParm(void)
void M_PushSpecialParameters(void) void M_PushSpecialParameters(void)
{ {
INT32 i; INT32 i;
char s[256];
boolean onetime = false;
for (i = 1; i < myargc; i++) for (i = 1; i < myargc; i++)
{ {
if (myargv[i][0] == '+') if (myargv[i][0] == '+')
{ {
strcpy(s, &myargv[i][1]); COM_BufAddText(&myargv[i][1]);
i++; i++;
// get the parameters of the command too // get the parameters of the command too
for (; i < myargc && myargv[i][0] != '+' && myargv[i][0] != '-'; i++) for (; i < myargc && myargv[i][0] != '+' && myargv[i][0] != '-'; i++)
{ {
strcat(s, " "); COM_BufAddText(va(" \"%s\"", myargv[i]));
if (!onetime)
{
strcat(s, "\"");
onetime = true;
}
strcat(s, myargv[i]);
}
if (onetime)
{
strcat(s, "\"");
onetime = false;
} }
strcat(s, "\n");
// push it // push it
COM_BufAddText(s); COM_BufAddText("\n");
i--; i--;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment