1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 19:29:09 +00:00

Fixes tab completion in the console

This commit is contained in:
philippelatulippe
2011-04-24 00:17:03 -04:00
parent 0a0f317970
commit f7b7fb97d6

View File

@ -41,6 +41,7 @@ const Int32 pfConsoleEngine::fMaxNumParams = 16;
static const char kTokenSeparators[] = " =\r\n\t,"; static const char kTokenSeparators[] = " =\r\n\t,";
static const char kTokenGrpSeps[] = " =\r\n._\t,"; static const char kTokenGrpSeps[] = " =\r\n._\t,";
//WARNING: Potentially increments the pointer passed to it.
static char *console_strtok( char *&line, hsBool haveCommand ) static char *console_strtok( char *&line, hsBool haveCommand )
{ {
char *begin = line; char *begin = line;
@ -461,6 +462,7 @@ hsBool pfConsoleEngine::FindPartialCmd( char *line, hsBool findAgain, hsBool pr
static pfConsoleCmd *lastCmd = nil; static pfConsoleCmd *lastCmd = nil;
static pfConsoleCmdGroup *lastGroup = nil, *lastParentGroup = nil; static pfConsoleCmdGroup *lastGroup = nil, *lastParentGroup = nil;
static char newStr[ 256 ]; static char newStr[ 256 ];
static char *originalLine = line;
/// Repeat search /// Repeat search
@ -525,13 +527,12 @@ hsBool pfConsoleEngine::FindPartialCmd( char *line, hsBool findAgain, hsBool pr
if( preserveParams ) if( preserveParams )
{ {
/// Preserve the rest of the string after the matched command /// Preserve the rest of the string after the matched command
ptr = strtok( nil, "\0" ); if( line != nil )
if( ptr != nil ) strcat( newStr, line );
strcat( newStr, ptr );
} }
// Copy back! // Copy back!
strcpy( line, newStr ); strcpy( originalLine, newStr );
return true; return true;
} }