oksh-noxz

[fork] Portable OpenBSD ksh, based on the Public Domain Korn Shell (pdksh).
git clone https://noxz.tech/git/oksh-noxz.git
oksh-noxz

commit: 7ee37a3eff9e561a64dc646c7d143fe8f65b04c7
parent: 0fa242b9524b83556716c421c6bce7092bd3ea97
author: Brian Callahan <bcallah@openbsd.org>
date:   Fri, 28 Oct 2022 16:32:16 -0400
Release oksh-7.2
MCVS/Entries62++++++++++----------
MREADME.md4+-
Mexec.c8++-
Mksh.19+--
Mmain.c2+-
Moksh.111++--
Msh.18+--
7 files changed, 54 insertions(+), 50 deletions(-)
diff --git a/CVS/Entries b/CVS/Entries
@@ -10,37 +10,37 @@
 /var.c/1.72/Result of merge//
 /vi.c/1.60/Result of merge+Fri Mar 12 03:48:27 2021//
 /emacs.c/1.89/Result of merge//
-/exec.c/1.75/Result of merge//
 /tty.c/1.19/Result of merge//
 /misc.c/1.78/Result of merge//
-/CONTRIBUTORS/1.11/Fri Apr 29 11:30:13 2022//
-/LEGAL/1.2/Fri Apr 29 11:30:13 2022//
-/Makefile/1.39/Fri Apr 29 11:30:22 2022//
-/NOTES/1.16/Fri Apr 29 11:30:13 2022//
-/PROJECTS/1.9/Fri Apr 29 11:30:13 2022//
-/README/1.16/Fri Apr 29 11:30:22 2022//
-/alloc.c/1.19/Fri Apr 29 11:30:13 2022//
-/c_ksh.c/1.62/Fri Apr 29 11:30:13 2022//
-/c_sh.c/1.64/Fri Apr 29 11:30:13 2022//
-/c_test.h/1.4/Fri Apr 29 11:30:13 2022//
-/c_ulimit.c/1.29/Fri Apr 29 11:30:13 2022//
-/edit.h/1.12/Fri Apr 29 11:30:13 2022//
-/expand.h/1.15/Fri Apr 29 11:30:13 2022//
-/expr.c/1.34/Fri Apr 29 11:30:13 2022//
-/jobs.c/1.62/Fri Apr 29 11:30:13 2022//
-/ksh.1/1.216/Fri Apr 29 11:30:23 2022//
-/lex.c/1.78/Fri Apr 29 11:30:13 2022//
-/lex.h/1.21/Fri Apr 29 11:30:13 2022//
-/mail.c/1.27/Fri Apr 29 11:30:13 2022//
-/path.c/1.23/Fri Apr 29 11:30:13 2022//
-/sh.1/1.154/Fri Apr 29 11:30:23 2022//
-/shf.c/1.34/Fri Apr 29 11:30:13 2022//
-/shf.h/1.8/Fri Apr 29 11:30:13 2022//
-/syn.c/1.40/Fri Apr 29 11:30:13 2022//
-/table.c/1.25/Fri Apr 29 11:30:13 2022//
-/table.h/1.15/Fri Apr 29 11:30:13 2022//
-/tree.c/1.34/Fri Apr 29 11:30:13 2022//
-/tree.h/1.12/Fri Apr 29 11:30:13 2022//
-/tty.h/1.6/Fri Apr 29 11:30:13 2022//
-/version.c/1.12/Fri Apr 29 11:30:13 2022//
+/CONTRIBUTORS/1.11/Wed Oct 26 01:59:06 2022//
+/LEGAL/1.2/Wed Oct 26 01:59:06 2022//
+/Makefile/1.39/Fri Oct 28 20:30:03 2022//
+/NOTES/1.16/Wed Oct 26 01:59:06 2022//
+/PROJECTS/1.9/Wed Oct 26 01:59:06 2022//
+/README/1.16/Fri Oct 28 20:30:03 2022//
+/alloc.c/1.19/Wed Oct 26 01:59:06 2022//
+/c_ksh.c/1.62/Wed Oct 26 01:59:06 2022//
+/c_sh.c/1.64/Wed Oct 26 01:59:06 2022//
+/c_test.h/1.4/Wed Oct 26 01:59:06 2022//
+/c_ulimit.c/1.29/Wed Oct 26 01:59:06 2022//
+/edit.h/1.12/Wed Oct 26 01:59:06 2022//
+/exec.c/1.76/Result of merge//
+/expand.h/1.15/Wed Oct 26 01:59:06 2022//
+/expr.c/1.34/Wed Oct 26 01:59:06 2022//
+/jobs.c/1.62/Wed Oct 26 01:59:06 2022//
+/ksh.1/1.217/Fri Oct 28 20:30:03 2022//
+/lex.c/1.78/Wed Oct 26 01:59:06 2022//
+/lex.h/1.21/Wed Oct 26 01:59:06 2022//
+/mail.c/1.27/Wed Oct 26 01:59:06 2022//
+/path.c/1.23/Wed Oct 26 01:59:06 2022//
+/sh.1/1.155/Fri Oct 28 20:30:03 2022//
+/shf.c/1.34/Wed Oct 26 01:59:06 2022//
+/shf.h/1.8/Wed Oct 26 01:59:06 2022//
+/syn.c/1.40/Wed Oct 26 01:59:06 2022//
+/table.c/1.25/Wed Oct 26 01:59:06 2022//
+/table.h/1.15/Wed Oct 26 01:59:06 2022//
+/tree.c/1.34/Wed Oct 26 01:59:06 2022//
+/tree.h/1.12/Wed Oct 26 01:59:06 2022//
+/tty.h/1.6/Wed Oct 26 01:59:06 2022//
+/version.c/1.12/Wed Oct 26 01:59:06 2022//
 D
diff --git a/README.md b/README.md
@@ -139,5 +139,5 @@ for details.
 
 Get a tarball
 -------------
-See releases tab. The latest release is oksh-7.1, which matches the ksh(1)
-from OpenBSD 7.1, released April 21, 2022.
+See releases tab. The latest release is oksh-7.2, which matches the ksh(1)
+from OpenBSD 7.2, released October 20, 2022.
diff --git a/exec.c b/exec.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: exec.c,v 1.75 2021/10/24 21:24:21 deraadt Exp $	*/
+/*	$OpenBSD: exec.c,v 1.76 2022/10/10 14:57:48 kn Exp $	*/
 
 /*
  * execute command tree
@@ -114,10 +114,12 @@ execute(struct op *volatile t,
 		for (iowp = t->ioact; *iowp != NULL; iowp++) {
 			if (iosetup(*iowp, tp) < 0) {
 				exstat = rv = 1;
-				/* Redirection failures for special commands
+				/* Except in the permanent case (exec 2>afile),
+				 * redirection failures for special commands
 				 * cause (non-interactive) shell to exit.
 				 */
-				if (tp && tp->type == CSHELL &&
+				if (tp && tp->val.f != c_exec &&
+				    tp->type == CSHELL &&
 				    (tp->flag & SPEC_BI))
 					errorf(NULL);
 				/* Deal with FERREXIT, quitenv(), etc. */
diff --git a/ksh.1 b/ksh.1
@@ -1,8 +1,8 @@
-.\"	$OpenBSD: ksh.1,v 1.216 2022/03/31 17:27:14 naddy Exp $
+.\"	$OpenBSD: ksh.1,v 1.217 2022/09/13 20:26:26 kn Exp $
 .\"
 .\"	Public Domain
 .\"
-.Dd $Mdocdate: March 31 2022 $
+.Dd $Mdocdate: September 13 2022 $
 .Dt KSH 1
 .Os
 .Sh NAME
@@ -745,9 +745,10 @@ Operators (e.g.\&
 must be unquoted.
 .It
 The second operand of the
-.Sq !=
+.Sq = ,
+.Sq ==
 and
-.Sq =
+.Sq !=
 expressions are patterns (e.g. the comparison
 .Ic [[ foobar = f*r ]]
 succeeds).
diff --git a/main.c b/main.c
@@ -301,7 +301,7 @@ main(int argc, char *argv[])
 	setint(global("PPID"), (int64_t) ppid);
 	/* setstr can't fail here */
 	setstr(global(version_param), ksh_version, KSH_RETURN_ERROR);
-	setstr(global("OKSH_VERSION"), "oksh 7.1", KSH_RETURN_ERROR);
+	setstr(global("OKSH_VERSION"), "oksh 7.2", KSH_RETURN_ERROR);
 
 	/* execute initialization statements */
 	for (wp = (char**) initcoms; *wp != NULL; wp++) {
diff --git a/oksh.1 b/oksh.1
@@ -1,8 +1,8 @@
-.\"	$OpenBSD: ksh.1,v 1.215 2021/05/04 21:03:30 naddy Exp $
+.\"	$OpenBSD: ksh.1,v 1.217 2022/09/13 20:26:26 kn Exp $
 .\"
 .\"	Public Domain
 .\"
-.Dd $Mdocdate: May 4 2021 $
+.Dd $Mdocdate: September 13 2022 $
 .Dt OKSH 1
 .Os
 .Sh NAME
@@ -745,9 +745,10 @@ Operators (e.g.\&
 must be unquoted.
 .It
 The second operand of the
-.Sq !=
+.Sq = ,
+.Sq ==
 and
-.Sq =
+.Sq !=
 expressions are patterns (e.g. the comparison
 .Ic [[ foobar = f*r ]]
 succeeds).
@@ -4012,7 +4013,7 @@ Times are reported to standard error; the format of the output is:
 .Pp
 If the
 .Fl p
-option is given the output is slightly longer:
+option is given, the output is slightly longer:
 .Bd -literal -offset indent
 real     0.00
 user     0.00
diff --git a/sh.1 b/sh.1
@@ -1,4 +1,4 @@
-.\"	$OpenBSD: sh.1,v 1.154 2022/03/31 17:27:14 naddy Exp $
+.\"	$OpenBSD: sh.1,v 1.155 2022/08/31 22:27:14 jmc Exp $
 .\"
 .\" Copyright (c) 2015 Jason McIntyre <jmc@openbsd.org>
 .\"
@@ -14,7 +14,7 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd $Mdocdate: March 31 2022 $
+.Dd $Mdocdate: August 31 2022 $
 .Dt SH 1
 .Os
 .Sh NAME
@@ -752,9 +752,9 @@ parameter 2 takes
 and so on.
 Parameters
 .Sq #
-to
+down to
 .Sq Po #\(mi Ns Ar n Pc Ns +1
-and downwards are unset and
+are unset and
 .Sq #
 is updated to the new number of positional parameters.
 If