From 16c47bbe915fd774c72a32bfb681ce1cf4c2baf3 Mon Sep 17 00:00:00 2001 From: tg Date: Sun, 31 May 2009 15:10:07 +0000 Subject: [PATCH] =?UTF-8?q?fix=20bug=20exhibited=20by=20t0000-basic.sh=20i?= =?UTF-8?q?ntroduced=20in=20R38=20shortly=20before=20the=20release:=20some?= =?UTF-8?q?times,=20a=20=E2=80=9Ccd=20-P=E2=80=9D=20would=20cause=20memory?= =?UTF-8?q?=20corruption=20because=20lalloc=20internal=20data=20was=20over?= =?UTF-8?q?written=20due=20to=20accidentally=20losing=20a=20=E2=80=9Cconti?= =?UTF-8?q?nue;=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check.t | 4 ++-- misc.c | 12 ++++++------ sh.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/check.t b/check.t index 3b018d6..b114d20 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.281 2009/05/27 19:52:35 tg Stab $ +# $MirOS: src/bin/mksh/check.t,v 1.282 2009/05/31 15:10:06 tg Stab $ # $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 $ @@ -25,7 +25,7 @@ # http://www.research.att.com/~gsf/public/ifs.sh expected-stdout: - @(#)MIRBSD KSH R38 2009/05/27 + @(#)MIRBSD KSH R38 2009/05/31 description: Check version of shell. stdin: diff --git a/misc.c b/misc.c index 4f928ec..bb00899 100644 --- a/misc.c +++ b/misc.c @@ -29,7 +29,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.107 2009/05/27 09:58:23 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.108 2009/05/31 15:10:07 tg Exp $"); #undef USE_CHVT #if defined(TIOCSCTTY) && !defined(MKSH_SMALL) @@ -1331,11 +1331,11 @@ do_phys_path(XString *xsp, char *xp, const char *pathl) llen = readlink(Xstring(*xsp, xp), lbuf, PATH_MAX - 1); if (llen < 0) { - /* EINVAL means it wasn't a symlink... */ - if (errno != EINVAL) { - xp = NULL; - goto out; - } + if (errno == EINVAL) + /* not a symbolic link */ + continue; + xp = NULL; + goto out; } lbuf[llen] = '\0'; diff --git a/sh.h b/sh.h index d6629f2..4348b3a 100644 --- a/sh.h +++ b/sh.h @@ -122,9 +122,9 @@ #define __SCCSID(x) __IDSTRING(sccsid,x) #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.304 2009/05/27 19:52:38 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.305 2009/05/31 15:10:07 tg Exp $"); #endif -#define MKSH_VERSION "R38 2009/05/27" +#define MKSH_VERSION "R38 2009/05/31" #ifndef MKSH_INCLUDES_ONLY