mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 03:32:02 +08:00
Fix rare crash bug in highlighting code
darcs-hash:20060724124629-ac50b-114944bc776f9451feeb967f4af68919d3ac404c.gz
This commit is contained in:
parent
713748c782
commit
787e99d901
|
@ -377,7 +377,6 @@ void parse_util_token_extent( const wchar_t *buff,
|
|||
|
||||
assert( cursor_pos >= 0 );
|
||||
|
||||
|
||||
a = b = pa = pb = 0;
|
||||
|
||||
parse_util_cmdsubst_extent( buff, cursor_pos, &begin, &end );
|
||||
|
@ -432,7 +431,7 @@ void parse_util_token_extent( const wchar_t *buff,
|
|||
If cursor is inside the token, this is the token we are
|
||||
looking for. If so, set a and b and break
|
||||
*/
|
||||
if( tok_end >= pos )
|
||||
if( (tok_last_type( &tok ) == TOK_STRING) && (tok_end >= pos ) )
|
||||
{
|
||||
a = begin + tok_get_pos( &tok );
|
||||
b = a + wcslen(tok_last(&tok));
|
||||
|
|
Loading…
Reference in New Issue
Block a user