From b58d7b80530259cb07e4f1cb1700ac2c37ecea51 Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 26 Nov 2012 22:39:14 +0000 Subject: [PATCH] =?UTF-8?q?fix=20regression=20wrt.=20pdksh=20(introduced?= =?UTF-8?q?=20between=20R40e=20and=20R40f)=20about=20how=20and=20when=20th?= =?UTF-8?q?e=20display=20is=20redrawn=20by=20reverting=20one=20bool=20back?= =?UTF-8?q?=20to=20an=20int,=20as=20it=E2=80=99s=20used=20as=20a=20counter?= =?UTF-8?q?=20(hm,=20should=20be=20an=20unsigned=20I=20guess=20but?= =?UTF-8?q?=E2=80=A6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit on the other hand, xlp_valid should’ve been a bool, make it so --- edit.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/edit.c b/edit.c index cc98a40..e446835 100644 --- a/edit.c +++ b/edit.c @@ -28,7 +28,7 @@ #ifndef MKSH_NO_CMDLINE_EDITING -__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.255 2012/10/21 18:33:46 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.256 2012/11/26 22:39:14 tg Exp $"); /* * in later versions we might use libtermcap for this, but since external @@ -931,14 +931,14 @@ static bool x_adj_ok; * we use x_adj_done so that functions can tell * whether x_adjust() has been called while they are active. */ -static bool x_adj_done; +static int x_adj_done; /* is incremented by x_adjust() */ static int x_col; static int x_displen; static int x_arg; /* general purpose arg */ static bool x_arg_defaulted; /* x_arg not explicitly set; defaulted to 1 */ -static int xlp_valid; +static bool xlp_valid; /* lastvis pointer was recalculated */ static char **x_histp; /* history position */ static int x_nextcmd; /* for newline-and-next */ @@ -1191,7 +1191,7 @@ x_init_prompt(void) if (x_col >= xx_cols) x_col %= xx_cols; x_displen = xx_cols - 2 - x_col; - x_adj_done = false; + x_adj_done = 0; pprompt(prompt, 0); if (x_displen < 1) { @@ -1364,7 +1364,7 @@ static int x_ins(const char *s) { char *cp = xcp; - bool adj = x_adj_done; + int adj = x_adj_done; if (x_do_ins(s, strlen(s)) < 0) return (-1); @@ -1641,7 +1641,7 @@ x_size2(char *cp, char **dcp) static void x_zots(char *str) { - bool adj = x_adj_done; + int adj = x_adj_done; x_lastcp(); while (*str && str < xlp && adj == x_adj_done) @@ -2860,7 +2860,7 @@ static void x_adjust(void) { /* flag the fact that we were called. */ - x_adj_done = true; + x_adj_done++; /* * we had a problem if the prompt length > xx_cols / 2 */ @@ -2982,7 +2982,7 @@ x_e_putc3(const char **cp) static void x_e_puts(const char *s) { - bool adj = x_adj_done; + int adj = x_adj_done; while (*s && adj == x_adj_done) x_e_putc3(&s);