From f5d4e21aa2aa44f056856ff5e5d672375eb2ee90 Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 21 May 2007 19:25:32 +0000 Subject: [PATCH] =?UTF-8?q?=E2=80=A2=20fix=20the=20third=20dramsey=20scrol?= =?UTF-8?q?ling=20bug=20for=20both=20^D=20at=20BOL=20and=20^W=20at=20EOL?= =?UTF-8?q?=20=20=20(I=20hope)=20=E2=80=A2=20fix=20another=20one=20I=20fou?= =?UTF-8?q?nd:=20after=20^D'ing,=20insert=20at=20BOL,=20the=20>=20is=20dis?= =?UTF-8?q?played=20=20=20one=20character=20too=20late?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 4 ++-- edit.c | 8 +++++--- sh.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/check.t b/check.t index 5d50357..a7ce1bb 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.105 2007/05/20 17:53:12 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.106 2007/05/21 19:25:30 tg Exp $ # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ @@ -7,7 +7,7 @@ # http://www.research.att.com/~gsf/public/ifs.sh expected-stdout: - @(#)MIRBSD KSH R29 2007/05/20 + @(#)MIRBSD KSH R29 2007/05/21 description: Check version of shell. category: pdksh diff --git a/edit.c b/edit.c index fddb593..b68eabc 100644 --- a/edit.c +++ b/edit.c @@ -5,7 +5,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.93 2007/05/21 12:24:44 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.94 2007/05/21 19:25:31 tg Exp $"); /* tty driver characters we are interested in */ typedef struct { @@ -1602,6 +1602,8 @@ x_ins(const char *s) while (cp > xcp) x_bs2(cp = utf_backch(cp)); } + if (xlp == xep - 1) + x_redraw(xx_cols); x_adj_ok = 1; return 0; } @@ -1693,9 +1695,9 @@ x_delete(int nc, int push) * there is no need to ' ','\b'. * But if we must, make sure we do the minimum. */ - if ((i = xx_cols - 2 - x_col) > 0) { + if ((i = xx_cols - 2 - x_col) > 0 || xep - xlp == 0) { nw = (nw < i) ? nw : i; - i = nw; + i = ++nw; while (i--) x_e_putc2(' '); i = nw; diff --git a/sh.h b/sh.h index 8453cbd..96a98eb 100644 --- a/sh.h +++ b/sh.h @@ -8,8 +8,8 @@ /* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */ /* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */ -#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.133 2007/05/20 17:53:13 tg Exp $" -#define MKSH_VERSION "R29 2007/05/20" +#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.134 2007/05/21 19:25:32 tg Exp $" +#define MKSH_VERSION "R29 2007/05/21" #if HAVE_SYS_PARAM_H #include