=============== Com_StartupVariable Searches for command line parameters that are set commands. If match is not NULL, only that cvar will be looked for. That is necessary because cddir and basedir need to be set before the filesystem is started, but all other sets should be after execing the config and default. =============== */
| 414 | =============== |
| 415 | */ |
| 416 | void Com_StartupVariable( const char *match ) { |
| 417 | char *s; |
| 418 | |
| 419 | for (int i=0 ; i < com_numConsoleLines ; i++) { |
| 420 | Cmd_TokenizeString( com_consoleLines[i] ); |
| 421 | if ( strcmp( Cmd_Argv(0), "set" ) ) { |
| 422 | continue; |
| 423 | } |
| 424 | |
| 425 | s = Cmd_Argv(1); |
| 426 | |
| 427 | if(!match || !strcmp(s, match)) |
| 428 | { |
| 429 | if((unsigned)Cvar_Flags(s) == CVAR_NONEXISTENT) |
| 430 | Cvar_Get(s, Cmd_ArgsFrom(2), CVAR_USER_CREATED); |
| 431 | else |
| 432 | Cvar_Set2(s, Cmd_ArgsFrom(2), qfalse); |
| 433 | } |
| 434 | } |
| 435 | } |
| 436 | |
| 437 | |
| 438 | /* |
no test coverage detected