aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_util.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-07-24 22:46:29 +1000
committerGravatar axel <axel@liljencrantz.se>2006-07-24 22:46:29 +1000
commit787e99d9013ec30f07bca57d3a397bcb22d7c1c9 (patch)
treef2a9c322d61a756fd1de3fc816f774bbbe8a755c /parse_util.c
parent713748c78274a39976a41898eeebf984464fd81d (diff)
Fix rare crash bug in highlighting code
darcs-hash:20060724124629-ac50b-114944bc776f9451feeb967f4af68919d3ac404c.gz
Diffstat (limited to 'parse_util.c')
-rw-r--r--parse_util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/parse_util.c b/parse_util.c
index 5fc6f9ac..74ad9e3d 100644
--- a/parse_util.c
+++ b/parse_util.c
@@ -376,7 +376,6 @@ void parse_util_token_extent( const wchar_t *buff,
CHECK( buff, );
assert( cursor_pos >= 0 );
-
a = b = pa = pb = 0;
@@ -432,11 +431,11 @@ 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));
-
+
// fwprintf( stderr, L"Whee %ls\n", *a );
break;