fix command line parsing when - is embeded in an arg (eg +gamedir artifact-rjs)

This commit is contained in:
Bill Currie 2000-12-15 23:24:22 +00:00
parent 32910a1b5f
commit 316b74eddc
5 changed files with 9 additions and 3 deletions

View file

@ -310,9 +310,10 @@ Cmd_StuffCmds_f (void)
if (com_cmdline[i] == '+') {
i++;
for (j = i; ((com_cmdline[j] != '+')
&& (com_cmdline[j] != '-')
&& (com_cmdline[j] != 0)); j++);
for (j = i; !((com_cmdline[j] == '+')
|| (com_cmdline[j] == '-'
&& (j==0 || com_cmdline[j - 1] == ' '))
|| (com_cmdline[j] == 0)); j++);
c = com_cmdline[j];
com_cmdline[j] = 0;