Files
haikuports/sys-libs/libedit/patches/libedit-20210910-3.1.patchset
2022-04-10 22:16:22 +02:00

161 lines
3.9 KiB
Plaintext

From 16e6736e5ab6bc363ef932c11867287f3d218845 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 26 Nov 2014 16:48:13 +0000
Subject: Haiku patch
diff --git a/configure.ac b/configure.ac
index 72a41f9..c03c84d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@ AM_CONDITIONAL(ENABLE_EXAMPLES, [test "$enable_examples" = "yes"])
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h termcap.h])
+AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdint.h stdlib.h string.h sys/errno.h errno.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h langinfo.h])
AC_CHECK_HEADER([ncurses.h], [],
[AC_CHECK_HEADER([curses.h], [],
diff --git a/src/editline/readline.h b/src/editline/readline.h
index e9f941a..b0db9e0 100644
--- a/src/editline/readline.h
+++ b/src/editline/readline.h
@@ -77,7 +77,7 @@ typedef KEYMAP_ENTRY *Keymap;
#ifndef CTRL
#include <sys/ioctl.h>
-#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
+#if !defined(__sun) && !defined(__hpux) && !defined(_AIX) && !defined(__HAIKU__)
#include <sys/ttydefaults.h>
#endif
#ifndef CTRL
diff --git a/src/vis.c b/src/vis.c
index a454874..9981ac2 100644
--- a/src/vis.c
+++ b/src/vis.c
@@ -75,6 +75,10 @@ __FBSDID("$FreeBSD$");
#include <wchar.h>
#include <wctype.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
#ifdef __weak_alias
__weak_alias(strvisx,_strvisx)
#endif
--
2.30.2
From 993bc4d5d290e6770d5046794659fac47c2ea367 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 26 Nov 2014 16:55:47 +0000
Subject: define NBBY
diff --git a/src/sys.h b/src/sys.h
index d2bcf11..44dca9d 100644
--- a/src/sys.h
+++ b/src/sys.h
@@ -125,4 +125,8 @@ extern char* tgoto(const char*, int, int);
extern char* tgetstr(char*, char**);
#endif
+#ifdef __HAIKU__
+#define NBBY 8
+#endif
+
#endif /* _h_sys */
--
2.30.2
From 7de9dc213a7b3a81b2c43e5af0df60ae6ee4d620 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Thu, 1 Feb 2018 11:05:59 +0000
Subject: gcc2 support.
diff --git a/src/hist.c b/src/hist.c
index 19ce1c1..2c88b28 100644
--- a/src/hist.c
+++ b/src/hist.c
@@ -188,12 +188,14 @@ hist_command(EditLine *el, int argc, const wchar_t **argv)
len = len * 4 + 1;
if (len >= maxlen) {
maxlen = len + 1024;
+ {
char *nbuf = el_realloc(buf, maxlen);
if (nbuf == NULL) {
el_free(buf);
return -1;
}
buf = nbuf;
+ }
}
strvis(buf, ptr, VIS_NL);
(void) fprintf(el->el_outfile, "%d\t%s\n",
--
2.30.2
From 1ea2455e8f597149a1612a8a0fab70245cf58a2b Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 1 May 2021 09:40:38 +0000
Subject: Another gcc2 patch
diff --git a/src/filecomplete.c b/src/filecomplete.c
index 84ae508..51501d6 100644
--- a/src/filecomplete.c
+++ b/src/filecomplete.c
@@ -707,6 +707,7 @@ fn_complete2(EditLine *el,
if (matches == NULL) {
goto out;
}
+ {
int i;
size_t matches_num, maxlen, match_len, match_display=1;
int single_match = matches[2] == NULL &&
@@ -814,6 +815,7 @@ out2:
out:
el_free(temp);
return retval;
+ }
}
int
--
2.30.2
From e86be215341d8a867f9f005ee66e389a8b4baf12 Mon Sep 17 00:00:00 2001
From: PulkoMandy <pulkomandy@pulkomandy.tk>
Date: Sun, 10 Apr 2022 22:10:17 +0200
Subject: Fix NULL pointer dereference if the prompt contains invalid UTF8
diff --git a/src/prompt.c b/src/prompt.c
index 026a746..bbad962 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -96,6 +96,13 @@ prompt_print(EditLine *el, int op)
p = ct_decode_string((char *)(void *)(*elp->p_func)(el),
&el->el_scratch);
+ if (!p) {
+ if (op == EL_PROMPT)
+ p = prompt_default(el);
+ else
+ p = prompt_default_r(el);
+ }
+
for (; *p; p++) {
if (elp->p_ignore == *p) {
wchar_t *litstart = ++p;
--
2.30.2