summaryrefslogtreecommitdiff
path: root/src/qcommon/cmd.c
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2015-09-20 18:50:36 -0500
committerTim Angus <tim@ngus.net>2016-04-07 11:07:48 +0100
commit50a9ce3114f3fc4533227b5d59917b19162c16e6 (patch)
tree083186fab6b14b9e18c0cb10ca6b1f3f6a4b92d3 /src/qcommon/cmd.c
parent932b463906c431acb4c7d5f906ed1dc6eb9a0ede (diff)
Early out of Cmd_CompleteArgument and Cmd_SetCommandCompletionFunc
Reported by Ensiform.
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;
}
}
}