mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-05 00:01:15 -03:00
Fix buffer inconsistency un ^U
darcs-hash:20051209024034-ac50b-a06c78f8f238f61c99ddcd4bee02f8b41af26c6c.gz
This commit is contained in:
11
reader.c
11
reader.c
@@ -2586,10 +2586,13 @@ wchar_t *reader_readline()
|
||||
|
||||
case R_BACKWARD_KILL_LINE:
|
||||
{
|
||||
wchar_t prev = data->buff[data->buff_pos];
|
||||
data->buff[data->buff_pos]=0;
|
||||
kill_add( data->buff );
|
||||
data->buff[data->buff_pos]=prev;
|
||||
wchar_t *str = wcsndup( data->buff, data->buff_pos );
|
||||
if( !str )
|
||||
die_mem();
|
||||
|
||||
kill_add( str );
|
||||
free( str );
|
||||
|
||||
data->buff_len = wcslen(data->buff +data->buff_pos);
|
||||
memmove( data->buff, data->buff +data->buff_pos, sizeof(wchar_t)*data->buff_len );
|
||||
data->buff[data->buff_len]=L'\0';
|
||||
|
||||
Reference in New Issue
Block a user