From d99541d7c83a7e24b77e093f548abb1a7b315c99 Mon Sep 17 00:00:00 2001 From: tg Date: Mon, 16 Mar 2009 15:50:13 +0000 Subject: [PATCH] revert previous commit for now. testscript which breaks: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit H4sIAAAAAAACA31TTUvDQBC951c804DtIQ0iiFhSPHiwiCDqzUpIuhO6JN2ETSS16n93Np+GFiGE zM6bN2/fTPQOro5xENYuEVLzBz9eaF6RlWupSpyHaXqzVuvyljbbDCRV0UR7WeLiHEtT4D2GCcUy pdNFh4pkg4wGZCV8Z6opTPOw3GI+swoq4ZIVZxqkSv0JqRAiWkBkmAJNegHIGG9vcAWcSnjM6dTo uby8vsL7+wLllhQQKKr4SoFv/8nbXE5pQcdpk4nlwH6AE7zer17uVs/BmHVftnUdxYh0yHbV3ghY 9wh2rQlBkdMm8PmIe57Bjfs7dTW9X/OoEG6lwzwnzYKA7+8jHpsJTuFN4+IjKhKZM6dpZ0xuQ2Nz 7bGB1F74zlebmzTm/PS+OB0GZz4HLcPgz+BeDxyS9S7YU6e3qZaQk5gZgRHvQtI59Eet7QwBWFnL O/F+ej9Fpmg0ug7OHrnqHy2+7y8x6DGEG3E0Az41RuPlYfXEEx0psrl8PAUebzf6ZklabgD8V3SS Z7Vo6xfOuQS6gQMAAA== 「mksh -o posix z」 failed in that it continues; 「mksh z」 correctly aborts let’s see what the obsd people have to say herefore --- check.t | 4 ++-- exec.c | 19 ++++--------------- sh.h | 4 ++-- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/check.t b/check.t index d438482..ca9cbbb 100644 --- a/check.t +++ b/check.t @@ -1,4 +1,4 @@ -# $MirOS: src/bin/mksh/check.t,v 1.259 2009/03/16 15:14:22 tg Exp $ +# $MirOS: src/bin/mksh/check.t,v 1.260 2009/03/16 15:50:11 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 R36 2009/03/16 ~test + @(#)MIRBSD KSH R36 2009/03/15 description: Check version of shell. stdin: diff --git a/exec.c b/exec.c index 8519c04..f7a4f9b 100644 --- a/exec.c +++ b/exec.c @@ -2,7 +2,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.49 2009/03/16 15:14:23 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.50 2009/03/16 15:50:12 tg Exp $"); static int comexec(struct op *, struct tbl *volatile, const char **, int volatile); @@ -25,8 +25,6 @@ execute(struct op *volatile t, { int i; volatile int rv = 0; - /* for FPOSIX only: rv being propagated or newly defined? */ - volatile bool rv_prop = false; int pv[2]; const char ** volatile ap; char ** volatile up; @@ -102,7 +100,6 @@ execute(struct op *volatile t, case TPAREN: rv = execute(t->left, flags|XFORK); - rv_prop = true; break; case TPIPE: @@ -210,10 +207,9 @@ execute(struct op *volatile t, case TOR: case TAND: rv = execute(t->left, XERROK); - if (t->right != NULL && (rv == 0) == (t->type == TAND)) { + if (t->right != NULL && (rv == 0) == (t->type == TAND)) rv = execute(t->right, flags & XERROK); - rv_prop = true; - } else + else flags |= XERROK; break; @@ -258,7 +254,6 @@ execute(struct op *volatile t, } } rv = 0; /* in case of a continue */ - rv_prop = true; if (t->type == TFOR) { while (*ap != NULL) { setstr(global(t->str), *ap++, KSH_UNWIND_ERROR); @@ -268,7 +263,6 @@ execute(struct op *volatile t, for (;;) { if (!(cp = do_selectargs(ap, is_first))) { rv = 1; - rv_prop = false; break; } is_first = false; @@ -298,7 +292,6 @@ execute(struct op *volatile t, rv = 0; /* in case of a continue */ while ((execute(t->left, XERROK) == 0) == (t->type == TWHILE)) rv = execute(t->right, flags & XERROK); - rv_prop = true; break; case TIF: @@ -308,7 +301,6 @@ execute(struct op *volatile t, rv = execute(t->left, XERROK) == 0 ? execute(t->right->left, flags & XERROK) : execute(t->right->right, flags & XERROK); - rv_prop = true; break; case TCASE: @@ -321,12 +313,10 @@ execute(struct op *volatile t, break; Found: rv = execute(t->left, flags & XERROK); - rv_prop = true; break; case TBRACE: rv = execute(t->left, flags & XERROK); - rv_prop = true; break; case TFUNCT: @@ -338,7 +328,6 @@ execute(struct op *volatile t, * (allows "ls -l | time grep foo"). */ rv = timex(t, flags & ~XEXEC); - rv_prop = true; break; case TEXEC: /* an eval'd TCOM */ @@ -364,7 +353,7 @@ execute(struct op *volatile t, quitenv(NULL); /* restores IO */ if ((flags&XEXEC)) unwind(LEXIT); /* exit child */ - if (rv != 0 && (!Flag(FPOSIX) || !rv_prop) &&!(flags & XERROK)) { + if (rv != 0 && !(flags & XERROK)) { trapsig(SIGERR_); if (Flag(FERREXIT)) unwind(LERROR); diff --git a/sh.h b/sh.h index 76bb165..7a467d7 100644 --- a/sh.h +++ b/sh.h @@ -102,9 +102,9 @@ #define __SCCSID(x) __IDSTRING(sccsid,x) #ifdef EXTERN -__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.277 2009/03/16 15:14:23 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.278 2009/03/16 15:50:13 tg Exp $"); #endif -#define MKSH_VERSION "R36 2009/03/16 ~test" +#define MKSH_VERSION "R36 2009/03/15" #ifndef MKSH_INCLUDES_ONLY