summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCliff Frey <cliff@meraki.com>2012-08-07 15:59:40 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2012-08-07 15:59:40 (GMT)
commit4919565c152f2ecee760b5419c947764e991ab3e (patch)
treea44eca676e32d78e8b0bb4a301b66f4308451155
parent2ffd710656d83c4bcc66cef10e1fe7deb1c47605 (diff)
downloadbusybox-4919565c152f2ecee760b5419c947764e991ab3e.tar.gz
busybox-4919565c152f2ecee760b5419c947764e991ab3e.tar.bz2
lineedit: fix Alt-D when cursor==0
Signed-off-by: Cliff Frey <cliff@meraki.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/lineedit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index b89748a..92bea85 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;
}