For for crash when typing backslash c

This commit is contained in:
ridiculousfish 2012-03-03 20:38:16 -08:00
parent a0bb2cdc6e
commit 5ae77b4317
2 changed files with 39 additions and 39 deletions

View file

@ -282,6 +282,7 @@ static void highlight_param( const wcstring &buffstr, std::vector<int> &colors,
else if( wcschr( L"c", buff[in_pos] ) ) else if( wcschr( L"c", buff[in_pos] ) )
{ {
colors.at(start_pos)=HIGHLIGHT_ESCAPE; colors.at(start_pos)=HIGHLIGHT_ESCAPE;
if (in_pos+2 < colors.size())
colors.at(in_pos+2)=normal_status; colors.at(in_pos+2)=normal_status;
} }
else if( wcschr( L"uUxX01234567", buff[in_pos] ) ) else if( wcschr( L"uUxX01234567", buff[in_pos] ) )

View file

@ -429,8 +429,7 @@ static wint_t input_try_mapping( const input_mapping_t &m)
input_unreadch( c ); input_unreadch( c );
const wchar_t *str = m.seq.c_str(); const wchar_t *str = m.seq.c_str();
for( j=0; str[j] != L'\0' && for( j=0; str[j] != L'\0' && str[j] == (c=input_common_readch( j>0 )); j++ )
str[j] == (c=input_common_readch( j>0 )); j++ )
; ;
if( str[j] == L'\0' ) if( str[j] == L'\0' )