From 22433f2717bb4e3bd7ee1c048a94207513fb4bb1 Mon Sep 17 00:00:00 2001 From: axel Date: Fri, 9 Dec 2005 12:47:18 +1000 Subject: [PATCH] Completion prefix was missing one character darcs-hash:20051209024718-ac50b-91cd117f5950726ecbf5451b415cf2f8041f689a.gz --- reader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reader.c b/reader.c index 7c66d6b46..017194fb4 100644 --- a/reader.c +++ b/reader.c @@ -1382,8 +1382,8 @@ static int handle_completions( array_list_t *comp ) 0, 0 ); - len = &data->buff[data->buff_pos]-prefix_start; - + len = &data->buff[data->buff_pos]-prefix_start+1; + if( len <= PREFIX_MAX_LEN ) { prefix = malloc( sizeof(wchar_t)*(len+1) ); @@ -1400,7 +1400,7 @@ static int handle_completions( array_list_t *comp ) ; prefix = wcsdupcat( tmp, - prefix_start + (len - PREFIX_MAX_LEN+1) ); + prefix_start + (len - PREFIX_MAX_LEN) ); prefix[PREFIX_MAX_LEN] = 0; }