summaryrefslogtreecommitdiff
path: root/Ports/dash/patches
diff options
context:
space:
mode:
Diffstat (limited to 'Ports/dash/patches')
-rw-r--r--Ports/dash/patches/fix-system.patch79
-rw-r--r--Ports/dash/patches/optional-helpers.patch25
2 files changed, 25 insertions, 79 deletions
diff --git a/Ports/dash/patches/fix-system.patch b/Ports/dash/patches/fix-system.patch
deleted file mode 100644
index 8d95830d86..0000000000
--- a/Ports/dash/patches/fix-system.patch
+++ /dev/null
@@ -1,79 +0,0 @@
---- dash-0.5.10.2/src/system.c.orig Sun May 10 01:45:02 2020
-+++ dash-0.5.10.2/src/system.c Sun May 10 01:50:52 2020
-@@ -131,64 +131,64 @@
-
- #ifndef HAVE_ISALPHA
- int isalnum(int c) {
-- return _isalnum(c);
-+ return (_ctype_[(int)(c)] & (_U | _L | _N));
- }
-
-
- int iscntrl(int c) {
-- return _iscntrl(c);
-+ return (_ctype_[(int)(c)] & (_C));
- }
-
-
- int islower(int c) {
-- return _islower(c);
-+ return ((_ctype_[(int)(c)] & (_U | _L)) == _L);
- }
-
-
- int isspace(int c) {
-- return _isspace(c);
-+ return (_ctype_[(int)(c)] & (_S));
- }
-
-
- int isalpha(int c) {
-- return _isalpha(c);
-+ return (_ctype_[(int)(c)] & (_U | _L));
- }
-
-
- int isdigit(int c) {
-- return _isdigit(c);
-+ return (_ctype_[(int)(c)] & (_N));
- }
-
-
- int isprint(int c) {
-- return _isprint(c);
-+ return (_ctype_[(int)(c)] & (_P | _U | _L | _N | _B));
- }
-
-
- int isupper(int c) {
-- return _isupper(c);
-+ return ((_ctype_[(int)(c)] & (_U | _L)) == _U);
- }
-
-
- #if HAVE_DECL_ISBLANK
- int isblank(int c) {
-- return _isblank(c);
-+ return (c == ' ' || c == '\t');
- }
- #endif
-
-
- int isgraph(int c) {
-- return _isgraph(c);
-+ return (_ctype_[(int)(c)] & (_P | _U | _L | _N));
- }
-
-
- int ispunct(int c) {
-- return _ispunct(c);
-+ return (_ctype_[(int)(c)] & (_P));
- }
-
-
- int isxdigit(int c) {
-- return _isxdigit(c);
-+ return (_ctype_[(int)(c)] & (_N | _X));
- }
- #endif
-
diff --git a/Ports/dash/patches/optional-helpers.patch b/Ports/dash/patches/optional-helpers.patch
new file mode 100644
index 0000000000..f0a28b1b74
--- /dev/null
+++ b/Ports/dash/patches/optional-helpers.patch
@@ -0,0 +1,25 @@
+diff -Naur dash-0.5.10.2/configure.ac dash-0.5.10.2.serenity/configure.ac
+--- dash-0.5.10.2/configure.ac 2021-04-12 09:02:46.066529775 +0200
++++ dash-0.5.10.2.serenity/configure.ac 2021-04-12 09:01:46.232094315 +0200
+@@ -181,5 +181,8 @@
+ if test "$enable_lineno" != "no"; then
+ AC_DEFINE([WITH_LINENO], 1, [Define if you build with -DWITH_LINENO])
+ fi
++AC_ARG_ENABLE(helpers, AS_HELP_STRING(--enable-helpers, \
++ [Build helpers]))
++AM_CONDITIONAL([BUILD_HELPERS], [test x$enable_helpers = xyes])
+ AC_CONFIG_FILES([Makefile src/Makefile])
+ AC_OUTPUT
+diff -Naur dash-0.5.10.2/src/Makefile.am dash-0.5.10.2.serenity/src/Makefile.am
+--- dash-0.5.10.2/src/Makefile.am 2021-04-12 09:14:04.178912517 +0200
++++ dash-0.5.10.2.serenity/src/Makefile.am 2021-04-12 09:13:28.768298013 +0200
+@@ -66,7 +66,9 @@
+ signames.c: mksignames
+ ./$^
+
++if BUILD_HELPERS
+ mksyntax: token.h
+
+ $(HELPERS): %: %.c
+ $(COMPILE_FOR_BUILD) -o $@ $<
++endif