aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-01-21 01:35:42 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-01-21 01:35:42 +0000
commitdfe59f94a8ddc3027a968785d6fb0a402f19da71 (patch)
treefe1edc36e16b2fed532631e70b148ed630674e8d /code/qcommon
parent4fa3d1f72ce1c71436892f8dd56e63bd1421b886 (diff)
downloadioquake3-aero-dfe59f94a8ddc3027a968785d6fb0a402f19da71.tar.gz
ioquake3-aero-dfe59f94a8ddc3027a968785d6fb0a402f19da71.zip
* Fix a bug with command/cvar autocompletion
git-svn-id: svn://svn.icculus.org/quake3/trunk@512 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon')
-rw-r--r--code/qcommon/common.c7
1 files changed, 6 insertions, 1 deletions
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;
}