skip start params when parsing argv in console

This commit is contained in:
oy 2010-10-31 17:53:00 +01:00
parent eace936869
commit 9e39239ce2

View file

@ -497,11 +497,23 @@ void CConsole::ParseArguments(int NumArgs, const char **ppArguments)
for(int i = 0; i < NumArgs; i++)
{
// check for scripts to execute
if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'f' && ppArguments[i][2] == 0 && NumArgs - i > 1)
if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'f' && ppArguments[i][2] == 0)
{
ExecuteFile(ppArguments[i+1]);
if(NumArgs - i > 1)
ExecuteFile(ppArguments[i+1]);
i++;
}
else if(!str_comp("-s", ppArguments[i]) || !str_comp("--silent", ppArguments[i]))
{
// skip silent param
continue;
}
else if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'd' && ppArguments[i][2] == 0)
{
// skip datadir param
++i;
continue;
}
else
{
// search arguments for overrides