about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Src/Zle/zle_utils.c14
2 files changed, 12 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index dc701050a..21803480c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-24  Peter Stephenson  <pws@csr.com>
+
+	* unposted: Jun T.: Src/Zle/zle_utils.c: backkill() in raw
+	mode didn't correctly calculate the number of characters to
+	kill.
+
 2008-04-23  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* unposted: Src/Zle/zle_misc.c: overwrite mode without
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c
index acc6c3717..4aca1958d 100644
--- a/Src/Zle/zle_utils.c
+++ b/Src/Zle/zle_utils.c
@@ -589,20 +589,18 @@ cuttext(ZLE_STRING_T line, int ct, int flags)
 mod_export void
 backkill(int ct, int flags)
 {
-    int i;
-
     UNMETACHECK();
     if (flags & CUT_RAW) {
-	i = (zlecs -= ct);
+	zlecs -= ct;
     } else {
-	int n = ct;
-	while (n--)
+	int origcs = zlecs;
+	while (ct--)
 	    DECCS();
-	i = zlecs;
+	ct = origcs - zlecs;
     }
 
-    cut(i, ct, flags);
-    shiftchars(i, ct);
+    cut(zlecs, ct, flags);
+    shiftchars(zlecs, ct);
     CCRIGHT();
 }