summaryrefslogtreecommitdiff
path: root/src/qcommon/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon/cmd.c')
-rw-r--r--src/qcommon/cmd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/qcommon/cmd.c b/src/qcommon/cmd.c
index 44a6f0ea..48489eff 100644
--- a/src/qcommon/cmd.c
+++ b/src/qcommon/cmd.c
@@ -706,6 +706,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;
}
}
}
@@ -782,8 +783,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;
}
}
}