summaryrefslogtreecommitdiff
path: root/src/qcommon/cmd.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2016-04-09 17:57:28 +0100
committerTim Angus <tim@ngus.net>2016-04-09 17:57:28 +0100
commitf45fbef604e05144057dec8d1dbfc5d4f5a2a822 (patch)
tree152d2a428b078f7a89756ea9e156695fc69f1686 /src/qcommon/cmd.c
parent7f9e97d611b4b267d9dd913144cb9632f96c90c2 (diff)
parent87abdd914988724e164ffb16380ad26be8420b84 (diff)
Merge branch 'master' into gpp
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;
}
}
}