From cca52d8edb5c5f91ca9ba51ce7c90f33e221b67a Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 24 Apr 2008 10:18:59 +0000 Subject: unposted: Jun T.: fix backkill() calculation of charaters to kill --- Src/Zle/zle_utils.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Src') 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(); } -- cgit 1.4.1