commit: 33e9115a2513430addc328937eb9d96d6f71c877
parent 059130110cd02d2c264eb25544269b4f75aa90d9
Author: Michael Forney <mforney@mforney.org>
Date: Sat, 4 Apr 2020 20:53:02 -0700
Use oksh instead of loksh
Diffstat:
7 files changed, 79 insertions(+), 48 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -153,9 +153,6 @@
path = pkg/libxkbcommon/src
url = https://github.com/xkbcommon/libxkbcommon.git
ignore = all
-[submodule "pkg/loksh/src"]
- path = pkg/loksh/src
- url = https://github.com/dimkr/loksh
[submodule "pkg/mc/src"]
path = pkg/mc/src
url = https://github.com/oridb/mc
@@ -219,6 +216,10 @@
[submodule "pkg/nginx/src"]
path = pkg/nginx/src
url = https://github.com/nginx/nginx
+[submodule "pkg/oksh/src"]
+ path = pkg/oksh/src
+ url = https://github.com/ibara/oksh.git
+ ignore = all
[submodule "pkg/openssh/src"]
path = pkg/openssh/src
url = https://github.com/openssh/openssh-portable
diff --git a/pkg/loksh/gen.lua b/pkg/loksh/gen.lua
@@ -1,44 +0,0 @@
-cflags{
- '-D _GNU_SOURCE',
- '-D EMACS',
- '-D SMALL',
- '-D VI',
- '-I $basedir/pkg/openbsd/include',
- '-idirafter $srcdir', -- for vis.h
-}
-
-exe('ksh', {
- 'alloc.c',
- 'c_ksh.c',
- 'c_sh.c',
- 'c_test.c',
- 'c_ulimit.c',
- 'edit.c',
- 'emacs.c',
- 'eval.c',
- 'exec.c',
- 'expr.c',
- 'history.c',
- 'io.c',
- 'jobs.c',
- 'lex.c',
- 'mail.c',
- 'main.c',
- 'misc.c',
- 'path.c',
- 'shf.c',
- 'syn.c',
- 'table.c',
- 'trap.c',
- 'tree.c',
- 'tty.c',
- 'var.c',
- 'version.c',
- 'vi.c',
- '$builddir/pkg/openbsd/libbsd.a',
-})
-file('bin/ksh', '755', '$outdir/ksh')
-sym('bin/sh', 'ksh')
-man{'ksh.1', 'sh.1'}
-
-fetch 'git'
diff --git a/pkg/loksh/src b/pkg/loksh/src
@@ -1 +0,0 @@
-Subproject commit 806e03150e8927179ee23d478cd9b4667c92512d
diff --git a/pkg/oksh/gen.lua b/pkg/oksh/gen.lua
@@ -0,0 +1,19 @@
+cflags{
+ '-D _GNU_SOURCE',
+ '-D EMACS',
+ '-D SMALL',
+ '-D VI',
+}
+
+exe('ksh', [[
+ alloc.c asprintf.c c_ksh.c c_sh.c c_test.c c_ulimit.c edit.c
+ emacs.c eval.c exec.c expr.c history.c io.c jobs.c lex.c mail.c
+ main.c misc.c path.c shf.c syn.c table.c trap.c tree.c tty.c var.c
+ version.c vi.c confstr.c reallocarray.c siglist.c signame.c
+ strlcat.c strlcpy.c strtonum.c unvis.c vis.c
+]])
+file('bin/ksh', '755', '$outdir/ksh')
+sym('bin/sh', 'ksh')
+man{'ksh.1', 'sh.1'}
+
+fetch 'git'
diff --git a/pkg/oksh/patch/0001-Use-typedef-for-function-pointer.patch b/pkg/oksh/patch/0001-Use-typedef-for-function-pointer.patch
@@ -0,0 +1,55 @@
+From 39e18e1c8b6979de2c56caa232795a645e37f6b2 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Sat, 4 Apr 2020 20:43:09 -0700
+Subject: [PATCH] Use typedef for function pointer
+
+---
+ emacs.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/emacs.c b/emacs.c
+index 5a7edc0..b4fad8e 100644
+--- a/emacs.c
++++ b/emacs.c
+@@ -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;
+--
+2.26.0
+
diff --git a/pkg/oksh/src b/pkg/oksh/src
@@ -0,0 +1 @@
+Subproject commit ff5ca9c1eaf8b0bbe6b75504e82e7bfdc243b894
diff --git a/pkg/loksh/ver b/pkg/oksh/ver