From cca52d8edb5c5f91ca9ba51ce7c90f33e221b67a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 24 Apr 2008 10:18:59 +0000 Subject: [PATCH] unposted: Jun T.: fix backkill() calculation of charaters to kill --- ChangeLog | 6 ++++++ Src/Zle/zle_utils.c | 14 ++++++-------- 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 + + * 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 * 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(); }