From 0eb5044ac67a734f9e376923fcbe2b08faa6cd4b Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 13 Jul 2014 11:34:29 +0000 Subject: [PATCH] =?UTF-8?q?fix=20rare=20infinite=20loop=20when=20invalid?= =?UTF-8?q?=20UTF-8=20is=20in=20the=20edit=20buffer=20From:=20Ivan=20?= =?UTF-8?q?=E2=80=9CColona=E2=80=9D=20Delalande=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 6 +++--- edit.c | 4 ++-- sh.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/check.t b/check.t index 6db4f3a..a7c971b 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.654 2014/06/29 11:28:26 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.655 2014/07/13 11:34:26 tg Exp $ # OpenBSD src/regress/bin/ksh updated: 2013/12/02 20:39:44 #- # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, @@ -27,7 +27,7 @@ # http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD expected-stdout: - @(#)MIRBSD KSH R50 2014/06/29 + @(#)MIRBSD KSH R50 2014/07/13 description: Check version of shell. stdin: @@ -36,7 +36,7 @@ name: KSH_VERSION category: shell:legacy-no --- expected-stdout: - @(#)LEGACY KSH R50 2014/06/29 + @(#)LEGACY KSH R50 2014/07/13 description: Check version of legacy shell. stdin: diff --git a/edit.c b/edit.c index 2459db7..ee5ed5c 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.275 2014/01/05 21:57:24 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.276 2014/07/13 11:34:28 tg Exp $"); /* * in later versions we might use libtermcap for this, but since external @@ -1628,7 +1628,7 @@ x_zots(char *str) int adj = x_adj_done; x_lastcp(); - while (*str && str < xlp && adj == x_adj_done) + while (*str && str < xlp && x_col < xx_cols && adj == x_adj_done) x_zotc3(&str); } diff --git a/sh.h b/sh.h index be716ab..b17dc4a 100644 --- a/sh.h +++ b/sh.h @@ -169,9 +169,9 @@ #endif #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.691 2014/06/29 11:28:28 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.692 2014/07/13 11:34:29 tg Exp $"); #endif -#define MKSH_VERSION "R50 2014/06/29" +#define MKSH_VERSION "R50 2014/07/13" /* arithmetic types: C implementation */ #if !HAVE_CAN_INTTYPES