about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-23 13:03:26 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-23 13:03:26 +0000
commit2bdcaa9a559fc635a08ac73ccd418eafc049d712 (patch)
tree6d3699004c65f7b0bcc7d442803664ebd8bec35b
parentbdecf74ef12452e2123ce66e42bc66aa81347b30 (diff)
downloadzsh-2bdcaa9a559fc635a08ac73ccd418eafc049d712.tar.gz
zsh-2bdcaa9a559fc635a08ac73ccd418eafc049d712.tar.xz
zsh-2bdcaa9a559fc635a08ac73ccd418eafc049d712.zip
zsh-workers/8010
-rw-r--r--Doc/Zsh/mod_deltochar.yo2
-rw-r--r--Src/Zle/deltochar.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/Doc/Zsh/mod_deltochar.yo b/Doc/Zsh/mod_deltochar.yo
index 4c3cf58e6..d90a6fc47 100644
--- a/Doc/Zsh/mod_deltochar.yo
+++ b/Doc/Zsh/mod_deltochar.yo
@@ -6,7 +6,7 @@ startitem()
 tindex(delete-to-char)
 item(tt(delete-to-char))(
 Read a character from the keyboard, and
-delete from the cursor position up to and including the next
+delete from the cursor position up to but not including the next
 (or, with repeat count var(n), the var(n)th) instance of that character.
 )
 enditem()
diff --git a/Src/Zle/deltochar.c b/Src/Zle/deltochar.c
index f0df33f95..d6a579d5c 100644
--- a/Src/Zle/deltochar.c
+++ b/Src/Zle/deltochar.c
@@ -43,7 +43,8 @@ deltochar(char **args)
 	    while (dest != ll && line[dest] != c)
 		dest++;
 	    if (dest != ll) {
-		dest++;
+		if (n > 0)
+		    dest++;
 		if (!n) {
 		    forekill(dest - cs, 0);
 		    ok++;
@@ -59,7 +60,7 @@ deltochar(char **args)
 		dest--;
 	    if (line[dest] == c) {
 		if (!n) {
-		    backkill(cs - dest, 1);
+		    backkill(cs - dest - 1, 1);
 		    ok++;
 		}
 		if (dest)