From 7913ec3c4ba3923742d3883ba587421db81fa9cc Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sat, 21 Jan 2006 01:35:42 +0000 Subject: [PATCH] * Fix a bug with command/cvar autocompletion --- code/qcommon/common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/qcommon/common.c b/code/qcommon/common.c index f89aa33b..ba95f091 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -2934,7 +2934,12 @@ static void FindMatches( const char *s ) { } // cut shortestMatch to the amount common with s - for ( i = 0 ; s[i] ; i++ ) { + for ( i = 0 ; shortestMatch[i] ; i++ ) { + if ( i >= strlen( s ) ) { + shortestMatch[i] = 0; + break; + } + if ( tolower(shortestMatch[i]) != tolower(s[i]) ) { shortestMatch[i] = 0; }