--- /dev/null
+diff -urN mksh.org/funcs.c mksh/funcs.c
+--- mksh.org/funcs.c 2020-08-27 21:53:11.000000000 +0200
++++ mksh/funcs.c 2023-10-05 19:06:16.456613978 +0200
+@@ -98,7 +98,6 @@
+ {Tsgbreak, c_brkcont},
+ {T__builtin, c_builtin},
+ {Tbuiltin, c_builtin},
+- {Tbcat, c_cat},
+ {Tcd, c_cd},
+ /* dash compatibility hack */
+ {"chdir", c_cd},
+@@ -152,9 +151,6 @@
+ #ifdef MKSH_PRINTF_BUILTIN
+ {"~printf", c_printf},
+ #endif
+-#if HAVE_SELECT
+- {"sleep", c_sleep},
+-#endif
+ #ifdef __MirBSD__
+ /* alias to "true" for historical reasons */
+ {"domainname", c_true},
+From 2f8a1b53b98c24c6506afdf1dd272febd49e65d2 Mon Sep 17 00:00:00 2001
+From: tg <tg@mirbsd.org>
+Date: Sun, 24 Jan 2021 19:41:07 +0000
+Subject: [PATCH] fix builtin removal-related fuckup
+
+---
+ check.t | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/check.t b/check.t
+index f22cf367a..c6e25d712 100644
+--- a/check.t
++++ b/check.t
+@@ -150,9 +150,8 @@ name: selftest-direct-builtin-call
+ description:
+ Check that direct builtin calls work
+ stdin:
+- ln -s "$__progname" cat || cp "$__progname" cat
+ ln -s "$__progname" echo || cp "$__progname" echo
+- ./echo -c 'echo foo' | ./cat -u
++ ./echo -c 'echo foo'
+ expected-stdout:
+ -c echo foo
+ ---
-diff -ur mksh.orig/check.t mksh/check.t
---- mksh.orig/check.t 2020-10-31 04:53:30.000000000 +0100
-+++ mksh/check.t 2021-01-18 19:12:47.413180226 +0100
-@@ -2484,7 +2484,7 @@
+diff -urNp -x '*.orig' mksh-59c.org/check.t mksh-59c/check.t
+--- mksh-59c.org/check.t 2020-10-31 04:53:30.000000000 +0100
++++ mksh-59c/check.t 2021-03-20 19:53:40.714261839 +0100
+@@ -2484,7 +2484,7 @@ expected-stdout:
!bc +bc ,bc 0bc 1bc ^bc cbc
!bc +bc ,bc -bc 0bc 1bc ^bc cbc
abc bbc
+bc ,bc -bc
-bc 0bc 1bc
---
-diff -ur mksh.orig/eval.c mksh/eval.c
---- mksh.orig/eval.c 2020-05-05 23:34:54.000000000 +0200
-+++ mksh/eval.c 2021-01-18 19:12:47.411180226 +0100
-@@ -1108,6 +1108,7 @@
+diff -urNp -x '*.orig' mksh-59c.org/eval.c mksh-59c/eval.c
+--- mksh-59c.org/eval.c 2020-05-05 23:34:54.000000000 +0200
++++ mksh-59c/eval.c 2021-03-20 19:53:40.717595272 +0100
+@@ -1108,6 +1108,7 @@ expand(
switch (ord(c)) {
case ORD('['):
case ORD('!'):
case ORD('-'):
case ORD(']'):
/*
-diff -ur mksh.orig/misc.c mksh/misc.c
---- mksh.orig/misc.c 2020-08-27 21:53:12.000000000 +0200
-+++ mksh/misc.c 2021-01-18 19:12:47.411180226 +0100
-@@ -1018,7 +1018,7 @@
+diff -urNp -x '*.orig' mksh-59c.org/misc.c mksh-59c/misc.c
+--- mksh-59c.org/misc.c 2020-08-27 21:53:12.000000000 +0200
++++ mksh-59c/misc.c 2021-03-20 19:53:40.717595272 +0100
+@@ -1018,7 +1018,7 @@ gmatch_cclass(const unsigned char *pat,
char *subp;
/* check for negation */
p += 2;
negated = true;
}
-diff -ur mksh.orig/sh.h mksh/sh.h
---- mksh.orig/sh.h 2020-10-31 04:53:33.000000000 +0100
-+++ mksh/sh.h 2021-01-18 19:12:47.412180226 +0100
-@@ -580,6 +580,7 @@
+diff -urNp -x '*.orig' mksh-59c.org/sh.h mksh-59c/sh.h
+--- mksh-59c.org/sh.h 2020-10-31 04:53:33.000000000 +0100
++++ mksh-59c/sh.h 2021-03-20 19:53:40.717595272 +0100
+@@ -580,6 +580,7 @@ extern int __cdecl setegid(gid_t);
*/
#define MAGIC KSH_BEL /* prefix for *?[!{,} during expand */
#define ISMAGIC(c) (ord(c) == ORD(MAGIC))
EXTERN const char *safe_prompt; /* safe prompt if PS1 substitution fails */
-Only in mksh: sh.h.orig
-diff -ur mksh.orig/main.c mksh/main.c
---- mksh.orig/main.c 2020-10-01 22:29:21.000000000 +0200
-+++ mksh/main.c 2021-01-18 19:11:59.615180226 +0100
-@@ -695,9 +695,14 @@
+diff -urNp -x '*.orig' mksh-59c.org/main.c mksh-59c/main.c
+--- mksh-59c.org/main.c 2020-10-01 22:29:21.000000000 +0200
++++ mksh-59c/main.c 2021-03-20 19:54:06.508364229 +0100
+@@ -695,9 +695,14 @@ main_init(int argc, const char *argv[],
if (Flag(FLOGIN))
include(substitute("$HOME/.profile", 0), 0, NULL, true);
if (Flag(FTALKING)) {
Summary(pl.UTF-8): Powłoka Korna z MirBSD
Name: mksh
Version: 59c
-Release: 1
+Release: 3
License: BSD
Group: Applications/Shells
Source0: https://www.mirbsd.org/MirOS/dist/mir/mksh/%{name}-R%{version}.tgz
Source2: get-source.sh
Patch0: %{name}-mkshrc_support.patch
Patch1: %{name}-circumflex.patch
+Patch2: drop-builtins.patch
URL: https://www.mirbsd.org/mksh.htm
%if %{with tests}
BuildRequires: ed
%patch0 -p1
%patch1 -p1
+%patch2 -p1
+
+sed -i -e 's|fgrep|grep -F|g' check.t
# sed rules instead of patch (needed update for every release)
sed -i -e 's|\(#define.*MKSH_VERSION.*\)"|\1 @DISTRO@"|g' sh.h