lineedit: fix Alt-D when cursor==0

Signed-off-by: Cliff Frey <cliff@meraki.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Cliff Frey 2012-08-07 17:59:40 +02:00 committed by Denys Vlasenko
parent 2ffd710656
commit 4919565c15

View File

@ -2527,9 +2527,9 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman
/* Delete word forward */
int nc, sc = cursor;
ctrl_right();
nc = cursor;
input_backward(cursor - sc);
while (--nc >= cursor)
nc = cursor - sc;
input_backward(nc);
while (--nc >= 0)
input_delete(1);
break;
}