Early out of Cmd_CompleteArgument and Cmd_SetCommandCompletionFunc

Reported by Ensiform.
This commit is contained in:
Zack Middleton committed 2015-09-20 18:51:20 -05:00
1 parent 5e09f20cd4
commit 68ab4e9548
1 file changed
+6 -2
+6 -2
View File
@@ -667,6 +667,7 @@ void Cmd_SetCommandCompletionFunc( const char *command, completionFunc_t complet
for( cmd = cmd_functions; cmd; cmd = cmd->next ) {
if( !Q_stricmp( command, cmd->name ) ) {
cmd->complete = complete;
return;
}
}
}
@@ -743,8 +744,11 @@ void Cmd_CompleteArgument( const char *command, char *args, int argNum ) {
cmd_function_t *cmd;
for( cmd = cmd_functions; cmd; cmd = cmd->next ) {
if( !Q_stricmp( command, cmd->name ) && cmd->complete ) {
cmd->complete( args, argNum );
if( !Q_stricmp( command, cmd->name ) ) {
if ( cmd->complete ) {
cmd->complete( args, argNum );
}
return;
}
}
}