From dfe59f94a8ddc3027a968785d6fb0a402f19da71 Mon Sep 17 00:00:00 2001 From: tma Date: Sat, 21 Jan 2006 01:35:42 +0000 Subject: * Fix a bug with command/cvar autocompletion git-svn-id: svn://svn.icculus.org/quake3/trunk@512 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/common.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'code') diff --git a/code/qcommon/common.c b/code/qcommon/common.c index f89aa33..ba95f09 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; } -- cgit v1.2.3