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: 99e90789844296e5549b25343253cfa35b6f0b0d
parent: 768bf7d9500cb8824c38da3a13c8202aaae53bd7
author: Brian Callahan <bcallah@openbsd.org>
date:   Wed, 2 May 2018 22:02:38 -0400
Update to latest OpenBSD code.
MCVS/Entries82++++++++++----------
DCVS/Entries.Log2-
MREADME.md2+-
Msyn.c12++-
4 files changed, 50 insertions(+), 48 deletions(-)
diff --git a/CVS/Entries b/CVS/Entries
@@ -1,46 +1,46 @@
 /config.h/1.19/Tue Jan 16 02:21:56 2018//
 /history.c/1.80/Tue Jan 16 02:21:56 2018//
 /emacs.c/1.84/Result of merge//
-/CONTRIBUTORS/1.10/Sat Apr 21 20:30:10 2018//
-/LEGAL/1.2/Sat Apr 21 20:30:11 2018//
-/Makefile/1.38/Sat Apr 21 20:30:20 2018//
-/NOTES/1.16/Sat Apr 21 20:30:11 2018//
-/PROJECTS/1.9/Sat Apr 21 20:30:11 2018//
-/README/1.16/Sat Apr 21 20:30:20 2018//
-/alloc.c/1.19/Sat Apr 21 20:30:11 2018//
-/c_ksh.c/1.60/Sat Apr 21 20:30:20 2018//
-/c_sh.c/1.63/Sat Apr 21 20:30:20 2018//
-/c_test.c/1.25/Sat Apr 21 20:30:20 2018//
-/c_test.h/1.4/Sat Apr 21 20:30:11 2018//
-/c_ulimit.c/1.28/Sat Apr 21 20:30:21 2018//
-/edit.c/1.65/Sat Apr 21 20:30:21 2018//
-/edit.h/1.11/Sat Apr 21 20:30:11 2018//
-/eval.c/1.60/Sat Apr 21 20:30:21 2018//
-/exec.c/1.73/Sat Apr 21 20:30:11 2018//
-/expand.h/1.15/Sat Apr 21 20:30:11 2018//
-/expr.c/1.33/Sat Apr 21 20:30:21 2018//
-/io.c/1.36/Sat Apr 21 20:30:11 2018//
-/jobs.c/1.60/Sat Apr 21 20:30:11 2018//
-/ksh.1/1.198/Sat Apr 21 20:30:11 2018//
-/lex.c/1.78/Sat Apr 21 20:30:11 2018//
-/lex.h/1.21/Sat Apr 21 20:30:11 2018//
-/mail.c/1.23/Sat Apr 21 20:30:21 2018//
 /main.c/1.91/Result of merge//
-/misc.c/1.70/Sat Apr 21 20:30:21 2018//
-/path.c/1.22/Sat Apr 21 20:30:11 2018//
-/sh.1/1.148/Sat Apr 21 20:30:11 2018//
-/sh.h/1.72/Sat Apr 21 20:30:21 2018//
-/shf.c/1.33/Sat Apr 21 20:30:11 2018//
-/shf.h/1.8/Sat Apr 21 20:30:11 2018//
-/syn.c/1.38/Sat Apr 21 20:30:11 2018//
-/table.c/1.25/Sat Apr 21 20:30:11 2018//
-/table.h/1.14/Sat Apr 21 20:30:21 2018//
-/trap.c/1.32/Sat Apr 21 20:30:11 2018//
-/tree.c/1.34/Sat Apr 21 20:30:21 2018//
-/tree.h/1.12/Sat Apr 21 20:30:11 2018//
-/tty.c/1.17/Sat Apr 21 20:30:11 2018//
-/tty.h/1.6/Sat Apr 21 20:30:11 2018//
-/var.c/1.68/Sat Apr 21 20:30:21 2018//
-/version.c/1.12/Sat Apr 21 20:30:11 2018//
-/vi.c/1.56/Sat Apr 21 20:30:11 2018//
+/CONTRIBUTORS/1.10/Thu May  3 01:58:43 2018//
+/LEGAL/1.2/Thu May  3 01:58:43 2018//
+/Makefile/1.38/Thu May  3 01:58:49 2018//
+/NOTES/1.16/Thu May  3 01:58:43 2018//
+/PROJECTS/1.9/Thu May  3 01:58:43 2018//
+/README/1.16/Thu May  3 01:58:49 2018//
+/alloc.c/1.19/Thu May  3 01:58:43 2018//
+/c_ksh.c/1.60/Thu May  3 01:58:43 2018//
+/c_sh.c/1.63/Thu May  3 01:58:43 2018//
+/c_test.c/1.25/Thu May  3 01:58:43 2018//
+/c_test.h/1.4/Thu May  3 01:58:43 2018//
+/c_ulimit.c/1.28/Thu May  3 01:58:43 2018//
+/edit.c/1.65/Thu May  3 01:58:43 2018//
+/edit.h/1.11/Thu May  3 01:58:43 2018//
+/eval.c/1.60/Thu May  3 01:58:43 2018//
+/exec.c/1.73/Thu May  3 01:58:43 2018//
+/expand.h/1.15/Thu May  3 01:58:43 2018//
+/expr.c/1.33/Thu May  3 01:58:43 2018//
+/io.c/1.36/Thu May  3 01:58:43 2018//
+/jobs.c/1.60/Thu May  3 01:58:43 2018//
+/ksh.1/1.198/Thu May  3 01:58:43 2018//
+/lex.c/1.78/Thu May  3 01:58:43 2018//
+/lex.h/1.21/Thu May  3 01:58:43 2018//
+/mail.c/1.23/Thu May  3 01:58:43 2018//
+/misc.c/1.70/Thu May  3 01:58:43 2018//
+/path.c/1.22/Thu May  3 01:58:43 2018//
+/sh.1/1.148/Thu May  3 01:58:43 2018//
+/sh.h/1.72/Thu May  3 01:58:43 2018//
+/shf.c/1.33/Thu May  3 01:58:43 2018//
+/shf.h/1.8/Thu May  3 01:58:43 2018//
+/syn.c/1.39/Thu May  3 01:58:49 2018//
+/table.c/1.25/Thu May  3 01:58:43 2018//
+/table.h/1.14/Thu May  3 01:58:43 2018//
+/trap.c/1.32/Thu May  3 01:58:43 2018//
+/tree.c/1.34/Thu May  3 01:58:43 2018//
+/tree.h/1.12/Thu May  3 01:58:43 2018//
+/tty.c/1.17/Thu May  3 01:58:43 2018//
+/tty.h/1.6/Thu May  3 01:58:43 2018//
+/var.c/1.68/Thu May  3 01:58:43 2018//
+/version.c/1.12/Thu May  3 01:58:43 2018//
+/vi.c/1.56/Thu May  3 01:58:43 2018//
 D
diff --git a/CVS/Entries.Log b/CVS/Entries.Log
@@ -1,2 +0,0 @@
-A D/tests////
-R D/tests////
diff --git a/README.md b/README.md
@@ -72,4 +72,4 @@ for details.
 
 Get a tarball
 -------------
-http://devio.us/~bcallah/oksh/oksh-20180421.tar.gz
+http://devio.us/~bcallah/oksh/oksh-20180502.tar.gz
diff --git a/syn.c b/syn.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: syn.c,v 1.38 2015/12/30 09:07:00 tedu Exp $	*/
+/*	$OpenBSD: syn.c,v 1.39 2018/04/24 08:25:16 kn Exp $	*/
 
 /*
  * shell parser (C version)
@@ -365,9 +365,13 @@ get_command(int cf)
 		syniocf &= ~(KEYWORD|ALIAS);
 		t = pipeline(0);
 		if (t) {
-			t->str = alloc(2, ATEMP);
-			t->str[0] = '\0'; /* TF_* flags */
-			t->str[1] = '\0';
+			if (t->str) {
+				t->str = str_save(t->str, ATEMP);
+			} else {
+				t->str = alloc(2, ATEMP);
+				t->str[0] = '\0'; /* TF_* flags */
+				t->str[1] = '\0';
+			}
 		}
 		t = block(TTIME, t, NULL, NULL);
 		break;