Changeset 4239 for trunk/console

Show
Ignore:
Timestamp:
09/30/05 16:03:13 (3 years ago)
Author:
emostar
Message:

Fix a crash of the console plugin crashing if you hit tab too many times without typeing anything.

If we expect a user, and the user hits tab without enteryting anything, show all users. This might suck..

Location:
trunk/console/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/console/src/console.cpp

    r4212 r4239  
    12171217      } 
    12181218 
     1219      // If we haven't typed anything, why should we tab? 
    12191220      if (!nPos) 
    12201221        break; 
     
    12861287 
    12871288      if (sTabCompletion.vszPartialMatch.size() == 1) 
    1288       { // Only one match 
     1289      { 
     1290        // Only one match 
    12891291        // Check if there is a space in the match 
    12901292        if (strchr(szMatch, ' ') != NULL) 
     
    13041306      } 
    13051307      else 
    1306       { // Multiple matches 
     1308      {  
     1309        if (szMatch == 0) break; 
     1310        // Multiple matches 
    13071311        Beep(); 
    13081312        // Check if there is a space in the match 
  • trunk/console/src/console_tab.cpp

    r4143 r4239  
    7474        FOR_EACH_USER_CONTINUE 
    7575 
    76       if (strncasecmp(_szPartialMatch, pUser->GetAlias(), nLen) == 0) 
     76      if (nLen == 0 || strncasecmp(_szPartialMatch, pUser->GetAlias(), nLen) == 0) 
    7777      { 
    7878        if (szMatch == 0) 
     
    9393    FOR_EACH_USER_END 
    9494 
     95/* This is commented, so we get a list of every user if the user hits tab  
     96   and hasn't typed anything. This might suck... 
    9597    if (nLen == 0) 
    9698      _sTabCompletion.szPartialMatch = 0; 
    9799    else 
    98100      _sTabCompletion.szPartialMatch = szMatch; 
     101*/ 
    99102  } 
    100103/*  else // Sub command time