From 892c6123c58e3545e300d935fbad2eeb7c8ae5de Mon Sep 17 00:00:00 2001 From: tg Date: Fri, 7 Oct 2005 18:34:18 +0000 Subject: [PATCH] Fix a redraw problem that occurs when a recalled history line has length equal to screen width - 2. Spotted by jmc@, tested by various. ok deraadt@ From otto@obsd --- edit.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/edit.c b/edit.c index 709f0ed..ee64127 100644 --- a/edit.c +++ b/edit.c @@ -1,7 +1,7 @@ -/** $MirOS: src/bin/mksh/edit.c,v 1.14 2005/10/07 18:32:23 tg Exp $ */ +/** $MirOS: src/bin/mksh/edit.c,v 1.15 2005/10/07 18:34:18 tg Exp $ */ /* $OpenBSD: edit.c,v 1.30 2005/09/11 18:08:47 otto Exp $ */ /* $OpenBSD: edit.h,v 1.8 2005/03/28 21:28:22 deraadt Exp $ */ -/* $OpenBSD: emacs.c,v 1.38 2005/08/01 04:27:31 deraadt Exp $ */ +/* $OpenBSD: emacs.c,v 1.39 2005/09/26 19:25:22 otto Exp $ */ /* $OpenBSD: vi.c,v 1.21 2005/03/30 17:16:37 deraadt Exp $ */ #include "sh.h" @@ -10,7 +10,7 @@ #include #include -__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.14 2005/10/07 18:32:23 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.15 2005/10/07 18:34:18 tg Exp $"); /* tty driver characters we are interested in */ typedef struct { @@ -1783,10 +1783,9 @@ x_load_hist(char **hp) xbp = xbuf; xep = xcp = xbuf + strlen(xbuf); xlp_valid = false; - if (xep > x_lastcp()) - x_goto(xep); - else + if (xep <= x_lastcp()) x_redraw(oldsize); + x_goto(xep); } static int