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: d5dc133a78fc3790f6338fe0353e631292050269
parent: 512565f882f7d4ba594838e736c1d252a00a1863
author: Brian Callahan <bcallah@openbsd.org>
date:   Fri, 8 May 2020 13:45:41 -0400
Pull in latest upstream code, which is #43 from Michael Forney.
https://marc.info/?l=openbsd-cvs&m=158894826204982&w=2
Fix #43
MCVS/Entries64++++++++++----------
Memacs.c12++--
2 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/CVS/Entries b/CVS/Entries
@@ -1,5 +1,4 @@
 /config.h/1.19/Tue Jan 16 02:21:56 2018//
-/emacs.c/1.86/Result of merge//
 /sh.h/1.75/Result of merge//
 /c_test.c/1.27/Result of merge//
 /edit.c/1.69/Result of merge//
@@ -12,35 +11,36 @@
 /history.c/1.84/Result of merge//
 /trap.c/1.33/Tue Dec 17 00:39:35 2019//
 /var.c/1.71/Result of merge//
-/CONTRIBUTORS/1.11/Sat May  2 18:31:21 2020//
-/LEGAL/1.2/Sat May  2 18:31:21 2020//
-/Makefile/1.39/Sat May  2 18:31:52 2020//
-/NOTES/1.16/Sat May  2 18:31:21 2020//
-/PROJECTS/1.9/Sat May  2 18:31:21 2020//
-/README/1.16/Sat May  2 18:31:52 2020//
-/alloc.c/1.19/Sat May  2 18:31:21 2020//
-/c_ksh.c/1.62/Sat May  2 18:31:21 2020//
-/c_sh.c/1.63/Sat May  2 18:31:21 2020//
-/c_test.h/1.4/Sat May  2 18:31:21 2020//
-/c_ulimit.c/1.29/Sat May  2 18:31:21 2020//
-/edit.h/1.12/Sat May  2 18:31:21 2020//
-/expand.h/1.15/Sat May  2 18:31:21 2020//
-/expr.c/1.34/Sat May  2 18:31:21 2020//
-/jobs.c/1.61/Sat May  2 18:31:21 2020//
-/ksh.1/1.208/Sat May  2 18:31:21 2020//
-/lex.c/1.78/Sat May  2 18:31:21 2020//
-/lex.h/1.21/Sat May  2 18:31:21 2020//
-/mail.c/1.27/Sat May  2 18:31:21 2020//
-/path.c/1.23/Sat May  2 18:31:21 2020//
-/sh.1/1.152/Sat May  2 18:31:21 2020//
-/shf.c/1.34/Sat May  2 18:31:21 2020//
-/shf.h/1.8/Sat May  2 18:31:21 2020//
-/syn.c/1.39/Sat May  2 18:31:21 2020//
-/table.c/1.25/Sat May  2 18:31:21 2020//
-/table.h/1.15/Sat May  2 18:31:21 2020//
-/tree.c/1.34/Sat May  2 18:31:21 2020//
-/tree.h/1.12/Sat May  2 18:31:21 2020//
-/tty.h/1.6/Sat May  2 18:31:21 2020//
-/version.c/1.12/Sat May  2 18:31:21 2020//
-/vi.c/1.56/Sat May  2 18:31:21 2020//
+/CONTRIBUTORS/1.11/Fri May  8 05:24:01 2020//
+/LEGAL/1.2/Fri May  8 05:24:01 2020//
+/Makefile/1.39/Fri May  8 17:43:41 2020//
+/NOTES/1.16/Fri May  8 05:24:01 2020//
+/PROJECTS/1.9/Fri May  8 05:24:01 2020//
+/README/1.16/Fri May  8 17:43:41 2020//
+/alloc.c/1.19/Fri May  8 05:24:01 2020//
+/c_ksh.c/1.62/Fri May  8 05:24:01 2020//
+/c_sh.c/1.63/Fri May  8 05:24:01 2020//
+/c_test.h/1.4/Fri May  8 05:24:01 2020//
+/c_ulimit.c/1.29/Fri May  8 05:24:01 2020//
+/edit.h/1.12/Fri May  8 05:24:01 2020//
+/emacs.c/1.87/Result of merge//
+/expand.h/1.15/Fri May  8 05:24:01 2020//
+/expr.c/1.34/Fri May  8 05:24:01 2020//
+/jobs.c/1.61/Fri May  8 05:24:01 2020//
+/ksh.1/1.208/Fri May  8 05:24:01 2020//
+/lex.c/1.78/Fri May  8 05:24:01 2020//
+/lex.h/1.21/Fri May  8 05:24:01 2020//
+/mail.c/1.27/Fri May  8 05:24:01 2020//
+/path.c/1.23/Fri May  8 05:24:01 2020//
+/sh.1/1.152/Fri May  8 05:24:01 2020//
+/shf.c/1.34/Fri May  8 05:24:01 2020//
+/shf.h/1.8/Fri May  8 05:24:01 2020//
+/syn.c/1.39/Fri May  8 05:24:01 2020//
+/table.c/1.25/Fri May  8 05:24:01 2020//
+/table.h/1.15/Fri May  8 05:24:01 2020//
+/tree.c/1.34/Fri May  8 05:24:01 2020//
+/tree.h/1.12/Fri May  8 05:24:01 2020//
+/tty.h/1.6/Fri May  8 05:24:01 2020//
+/version.c/1.12/Fri May  8 05:24:01 2020//
+/vi.c/1.56/Fri May  8 05:24:01 2020//
 D
diff --git a/emacs.c b/emacs.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: emacs.c,v 1.86 2019/04/03 14:55:12 jca Exp $	*/
+/*	$OpenBSD: emacs.c,v 1.87 2020/05/08 14:30:42 jca Exp $	*/
 
 /*
  *  Emacs-like command line editing and history
@@ -49,8 +49,10 @@ static	Area	aedit;
 #define	KEOL	1		/* ^M, ^J */
 #define	KINTR	2		/* ^G, ^C */
 
+typedef int (*kb_func)(int);
+
 struct	x_ftab {
-	int		(*xf_func)(int c);
+	kb_func		xf_func;
 	const char	*xf_name;
 	short		xf_flags;
 };
@@ -869,7 +871,7 @@ x_eot_del(int c)
 		return (x_del_char(c));
 }
 
-static void *
+static kb_func
 kb_find_hist_func(char c)
 {
 	struct kb_entry		*k;
@@ -1323,7 +1325,7 @@ kb_del(struct kb_entry *k)
 }
 
 static struct kb_entry *
-kb_add_string(void *func, void *args, char *str)
+kb_add_string(kb_func func, void *args, char *str)
 {
 	unsigned int		ele, count;
 	struct kb_entry		*k;
@@ -1358,7 +1360,7 @@ kb_add_string(void *func, void *args, char *str)
 }
 
 static struct kb_entry *
-kb_add(void *func, ...)
+kb_add(kb_func func, ...)
 {
 	va_list			ap;
 	unsigned char		ch;