remove -basedir handling. wrong idea, bad implementation (fixed size MALLOC?!?)

This commit is contained in:
Bill Currie 2000-11-17 02:45:23 +00:00
parent aad43f6d00
commit ed9ca01ada

View file

@ -300,7 +300,7 @@ void Cmd_StuffCmds_f (void)
return; return;
// pull out the commands // pull out the commands
build = malloc (s+21); // LordHavoc: +21 instead of +1 to account for potential basedir expansion build = malloc (s+1);
build[0] = 0; build[0] = 0;
for (i=0 ; i<s-1 ; i++) for (i=0 ; i<s-1 ; i++)
@ -322,28 +322,6 @@ void Cmd_StuffCmds_f (void)
com_cmdline[j] = c; com_cmdline[j] = c;
i = j-1; 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); //Con_Printf("[\n%s]\n",build);