From fec876cdcf902f8fa574fd9f9ef8043005afd0f1 Mon Sep 17 00:00:00 2001 From: tg Date: Tue, 22 May 2007 21:01:38 +0000 Subject: [PATCH] fix Message-ID: (by dramsey again, you're DA MAN) by replicating some of the x_redraw() logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that this is correct, a construct like the full-fledged | x_e_putc2((xep > xlp) ? ((xbp > xbuf) ? '*' : '>') : (xbp > xbuf) ? '<' : ' '); is not needed since if (xep > xlp) && (xbp > xbuf) – i.e. in the '*' case – x_redraw() will be called anyway and because (xx_cols - 2 - x_col) == 0 the code won't be triggered. --- edit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/edit.c b/edit.c index 2138589..b120240 100644 --- a/edit.c +++ b/edit.c @@ -5,7 +5,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.95 2007/05/22 19:27:05 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.96 2007/05/22 21:01:38 tg Exp $"); /* tty driver characters we are interested in */ typedef struct { @@ -1697,12 +1697,11 @@ x_delete(int nc, int push) */ if ((i = xx_cols - 2 - x_col) > 0 || xep - xlp == 0) { nw = (nw < i) ? nw : i; - if (xbp == xbuf) - ++nw; i = nw; while (i--) x_e_putc2(' '); - i = nw; + x_e_putc2((xep > xlp) ? '>' : (xbp > xbuf) ? '<' : ' '); + i = ++nw; while (i--) x_e_putc2('\b'); }