From: Cliff Frey Date: Tue, 7 Aug 2012 15:59:40 +0000 (+0200) Subject: lineedit: fix Alt-D when cursor==0 X-Git-Tag: 1_21_0~97 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4919565c152f2ecee760b5419c947764e991ab3e;p=oweals%2Fbusybox.git lineedit: fix Alt-D when cursor==0 Signed-off-by: Cliff Frey Signed-off-by: Denys Vlasenko --- diff --git a/libbb/lineedit.c b/libbb/lineedit.c index b89748a1c..92bea856e 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -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; }