aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-12-11 14:30:17 +1000
committerGravatar axel <axel@liljencrantz.se>2005-12-11 14:30:17 +1000
commit2cac04850b950184ea431c9d9b5d1261236d4ed9 (patch)
tree2a1f1d3e237c74618cc631e474e1e4824784c003 /reader.c
parent2619f1752d50b734cc6871e362da2bee8df07545 (diff)
Fix crash bug in token search
darcs-hash:20051211043017-ac50b-137695bd9bb9c523d5b5288a5d4263e4c4242edf.gz
Diffstat (limited to 'reader.c')
-rw-r--r--reader.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/reader.c b/reader.c
index 017194fb..3428d2c8 100644
--- a/reader.c
+++ b/reader.c
@@ -1756,8 +1756,12 @@ void reader_current_token_extent( wchar_t **tok_begin,
break;
}
- pa = begin + tok_get_pos( &tok );
- pb = pa + wcslen(tok_last(&tok));
+
+ if( tok_last_type( &tok ) == TOK_STRING )
+ {
+ pa = begin + tok_get_pos( &tok );
+ pb = pa + wcslen(tok_last(&tok));
+ }
}
// fwprintf( stderr, L"Res: %d %d\n", *a-data->buff, *b-data->buff );
@@ -1876,7 +1880,7 @@ static void handle_token_history( int forward, int reset )
int current_pos;
tokenizer tok;
- if(reset )
+ if( reset )
{
/*
Start a new token search using the current token