git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5944
d7cf8633-e32d-0410-b094-
e92efae38249
// $<number> is replaced with an argument to this alias (or copied as-is if no such parameter exists), can be multiple digits
if( *in == '$' ) {
outtext[outlen++] = *in++;
// $<number> is replaced with an argument to this alias (or copied as-is if no such parameter exists), can be multiple digits
if( *in == '$' ) {
outtext[outlen++] = *in++;
- } else if( *in == '*' ) {
+ } else if( *in == '*' && alias ) {
const char *linein = Cmd_Args();
const char *linein = Cmd_Args();
- if( !alias )
- continue;
-
- // include all params
+ // include all parameters
if (linein) {
while( *linein && outlen < maxoutlen ) {
outtext[outlen++] = *linein++;
if (linein) {
while( *linein && outlen < maxoutlen ) {
outtext[outlen++] = *linein++;
- } else if( '0' <= *in && *in <= '9' ) {
+ } else if( '0' <= *in && *in <= '9' && alias ) {
char *nexttoken;
int argnum;
char *nexttoken;
int argnum;
- if( !alias )
- continue;
-
argnum = strtol( in, &nexttoken, 10 );
if( 0 <= argnum && argnum < Cmd_Argc() ) {
argnum = strtol( in, &nexttoken, 10 );
if( 0 <= argnum && argnum < Cmd_Argc() ) {
- Con_Printf( "Warning: could not find cvar %s when expanding alias %s\n %s\n", com_token, alias->name, alias->value );
+ if( alias ) {
+ Con_Printf( "Warning: could not find cvar %s when expanding alias %s\n %s\n", com_token, alias->name, alias->value );
+ } else {
+ Con_Printf( "Warning: could not find cvar %s\n", com_token );
+ }
outtext[outlen++] = '$';
}
}
outtext[outlen++] = '$';
}
}