Fix a crash in complete -C

This commit is contained in:
ridiculousfish
2012-02-26 13:46:21 -08:00
parent b30090f946
commit ad7c5886bc
2 changed files with 10 additions and 9 deletions

View File

@@ -1507,8 +1507,8 @@ bool completer_t::complete_variable(const wcstring &str, int start_offset)
*/
bool completer_t::try_complete_variable( const wcstring &str )
{
size_t i, len = str.size();
for( i=len-1; i>=0; i-- )
size_t i = str.size();
while (i--)
{
wchar_t c = str.at(i);
if( c == L'$' )