sync; fold oksh-seterror test into errexit-*; use print not printf

This commit is contained in:
tg 2009-03-22 18:28:35 +00:00
parent abba28e8b1
commit 62b28858d4
4 changed files with 21 additions and 24 deletions

33
check.t
View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.263 2009/03/22 15:47:23 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.264 2009/03/22 18:28:33 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/17
@(#)MIRBSD KSH R36 2009/03/22
description:
Check version of shell.
stdin:
@ -4301,8 +4301,8 @@ description:
category: os:mirbsd
stdin:
mkdir zd zd/a zd/b
printf 'all:\n\t@echo eins\n\t@exit 42\n' >zd/a/Makefile
printf 'all:\n\t@echo zwei\n' >zd/b/Makefile
print 'all:\n\t@echo eins\n\t@exit 42\n' >zd/a/Makefile
print 'all:\n\t@echo zwei\n' >zd/b/Makefile
wd=$(pwd)
set -e
for entry in a b; do ( set -e; if [[ -d $wd/zd/$entry.i386 ]]; then _newdir_="$entry.i386"; else _newdir_="$entry"; fi; if [[ -z $_THISDIR_ ]]; then _nextdir_="$_newdir_"; else _nextdir_="$_THISDIR_/$_newdir_"; fi; _makefile_spec_=; [[ ! -f $wd/zd/$_newdir_/Makefile.bsd-wrapper ]] || _makefile_spec_="-f Makefile.bsd-wrapper"; subskipdir=; for skipdir in ; do subentry=${skipdir#$entry}; if [[ $subentry != $skipdir ]]; then if [[ -z $subentry ]]; then echo "($_nextdir_ skipped)"; break; fi; subskipdir="$subskipdir ${subentry#/}"; fi; done; if [[ -z $skipdir || -n $subentry ]]; then echo "===> $_nextdir_"; cd $wd/zd/$_newdir_; make SKIPDIR="$subskipdir" $_makefile_spec_ _THISDIR_="$_nextdir_" all; fi; ) done 2>&1 | sed "s!$wd!WD!g"
@ -4328,6 +4328,17 @@ expected-stdout:
nein
expected-stderr-pattern: !/unexpected op/
---
name: test-precedence-1
description:
Check a weird precedence case (and POSIX echo)
stdin:
test \( -f = -f \)
rv=$?
set -o posix
echo -e $rv
expected-stdout:
-e 0
---
name: mkshrc-1
description:
Check that ~/.mkshrc works correctly.
@ -5429,20 +5440,6 @@ expected-stdout:
bar
baz
---
name: oksh-seterror
description:
$OpenBSD: seterror.sh,v 1.1 2003/02/09 18:52:49 espie Exp $
set -e is supposed to abort the script for errors that
are not caught otherwise. pdksh fails this test.
stdin:
set -e
for i in 1 2 3
do
false && true
done
true
expected-fail: yes
---
name: oksh-shcrash
description:
src/regress/bin/ksh/shcrash.sh,v 1.1

4
exec.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.52 2009/03/22 18:20:36 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/exec.c,v 1.53 2009/03/22 18:28:34 tg Exp $");
static int comexec(struct op *, struct tbl *volatile, const char **,
int volatile, volatile int *);
@ -22,7 +22,7 @@ static void dbteste_error(Test_env *, int, const char *);
int
execute(struct op *volatile t,
volatile int flags, /* if XEXEC don't fork */
volatile int *xerrok)
volatile int * volatile xerrok)
{
int i;
volatile int rv = 0, dummy = 0;

View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.99 2009/03/22 17:58:58 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.100 2009/03/22 18:28:34 tg Exp $");
/* A leading = means assignments before command are kept;
* a leading * means a POSIX special builtin;
@ -2767,7 +2767,7 @@ test_primary(Test_env *te, bool do_eval)
* so that something like test \( -f = -f \) is accepted
*/
if ((te->flags & TEF_DBRACKET) || (&te->pos.wp[1] < te->wp_end &&
!test_isop(te, TM_BINOP, te->pos.wp[1]))) {
!test_isop(TM_BINOP, te->pos.wp[1]))) {
if ((op = (*te->isa)(te, TM_UNOP))) {
/* unary expression */
opnd1 = (*te->getopnd)(te, op, do_eval);

4
sh.h
View File

@ -102,9 +102,9 @@
#define __SCCSID(x) __IDSTRING(sccsid,x)
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.282 2009/03/22 17:47:38 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.283 2009/03/22 18:28:35 tg Exp $");
#endif
#define MKSH_VERSION "R36 2009/03/17"
#define MKSH_VERSION "R36 2009/03/22"
#ifndef MKSH_INCLUDES_ONLY