summaryrefslogtreecommitdiffstats
path: root/linenoise
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-09-16 06:12:36 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-09-16 06:12:36 -0700
commit9d0b24405f275b811fe6673a224f0b5b5bbd3de9 (patch)
tree69ea56ed4f21511895279f6c8a02b3c696f2f904 /linenoise
parent81709906eeb5e853d03f5e966e631720c8632566 (diff)
downloadtxr-9d0b24405f275b811fe6673a224f0b5b5bbd3de9.tar.gz
txr-9d0b24405f275b811fe6673a224f0b5b5bbd3de9.tar.bz2
txr-9d0b24405f275b811fe6673a224f0b5b5bbd3de9.zip
linenoise: bugfix: Ctrl-D checks wrong length field.
* linenoise/linenoise.c (edit): Delete if the data length is nonzero, not the display length.
Diffstat (limited to 'linenoise')
-rw-r--r--linenoise/linenoise.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index 52fc4977..a71226ba 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -1082,7 +1082,7 @@ static int edit(lino_t *l, const char *prompt)
break;
case CTL('D'): /* remove char at right of cursor, or if the
line is empty, act as end-of-file. */
- if (l->len > 0) {
+ if (l->dlen > 0) {
edit_delete(l);
} else {
if (l->history_len > 0) {