added back -basedir

This commit is contained in:
Forest Hale 2000-09-11 12:26:53 +00:00
parent 9f476ee5c6
commit 69edf96241

View file

@ -294,7 +294,7 @@ void Cmd_StuffCmds_f (void)
return;
// pull out the commands
build = malloc (s+1);
build = malloc (s+21); // LordHavoc: +21 instead of +1 to account for potential basedir expansion
build[0] = 0;
for (i=0 ; i<s-1 ; i++)
@ -316,6 +316,28 @@ void Cmd_StuffCmds_f (void)
com_cmdline[j] = c;
i = j-1;
}
// LordHavoc: added -basedir back, though I don't think this is the best place, or the most ideal way...
else if (com_cmdline[i] == '-')
{
i++;
for (j=i ; ((com_cmdline[j] != '+')
&& (com_cmdline[j] != '-')
&& (com_cmdline[j] != 0)) ; j++)
;
c = com_cmdline[j];
com_cmdline[j] = 0;
if (strncmp(com_cmdline+i,"basedir ", 8)==0)
{
strcat (build, "set fs_userpath ");
strcat (build, com_cmdline+i+8);
strcat (build, "\n");
}
com_cmdline[j] = c;
i = j-1;
}
}
//Con_Printf("[\n%s]\n",build);