fix two inverse logic mistakes (I’m apparently r̲e̲a̲l̲l̲y̲ fond of them… ☹)

This commit is contained in:
tg
2012-06-25 16:34:58 +00:00
parent 5386859b3f
commit 2621715a17
2 changed files with 19 additions and 6 deletions

21
check.t
View File

@@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.541 2012/06/25 16:31:16 tg Exp $ # $MirOS: src/bin/mksh/check.t,v 1.542 2012/06/25 16:34:56 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas 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: 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 $ # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@@ -4163,9 +4163,9 @@ stdin:
set -- `false` set -- `false`
echo rv=$? echo rv=$?
expected-stdout: expected-stdout:
FPOSIX=0 FSH=0 rv=0 FPOSIX=0 FSH=0 rv=1
FPOSIX=0 FSH=1 rv=0 FPOSIX=0 FSH=1 rv=1
FPOSIX=1 FSH=0 rv=0 FPOSIX=1 FSH=0 rv=1
--- ---
name: regression-11 name: regression-11
description: description:
@@ -8232,6 +8232,7 @@ name: fd-cloexec-1
description: description:
Verify that file descriptors > 2 are private for Korn shells Verify that file descriptors > 2 are private for Korn shells
AT&T ksh93 does this still, which means we must keep it as well AT&T ksh93 does this still, which means we must keep it as well
category: shell:legacy-no
file-setup: file 644 "test.sh" file-setup: file 644 "test.sh"
echo >&3 Fowl echo >&3 Fowl
stdin: stdin:
@@ -8254,6 +8255,18 @@ stdin:
expected-stdout: expected-stdout:
Fowl Fowl
--- ---
name: fd-cloexec-3
description:
Verify that file descriptors > 2 are not private for LEGACY KSH
category: shell:legacy-yes
file-setup: file 644 "test.sh"
echo >&3 Fowl
stdin:
exec 3>&1
"$__progname" test.sh
expected-stdout:
Fowl
---
name: comsub-1a name: comsub-1a
description: description:
COMSUB are now parsed recursively, so this works COMSUB are now parsed recursively, so this works

View File

@@ -38,7 +38,7 @@
#endif #endif
#endif #endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.221 2012/06/25 16:17:54 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.222 2012/06/25 16:34:58 tg Exp $");
#if HAVE_KILLPG #if HAVE_KILLPG
/* /*
@@ -2616,7 +2616,7 @@ c_exec(const char **wp MKSH_A_UNUSED)
for (i = 0; i < NUFILE; i++) { for (i = 0; i < NUFILE; i++) {
if (e->savefd[i] > 0) if (e->savefd[i] > 0)
close(e->savefd[i]); close(e->savefd[i]);
#ifdef MKSH_LEGACY_MODE #ifndef MKSH_LEGACY_MODE
/* /*
* keep all file descriptors > 2 private for ksh, * keep all file descriptors > 2 private for ksh,
* but not for POSIX or legacy/kludge sh * but not for POSIX or legacy/kludge sh