# HG changeset patch # User Markus Mützel # Date 1668268841 -3600 # Node ID 5ef7d51c2195e3070248e353c97c7322dd857a51 # Parent efc41d530cff35aff63be580eec29da57f942759 readline: Update to version 8.2-001. * src/readline.mk: Update version and checksum. * src/readline-0-001-upstream.patch: Upstream patch re-formatted to apply in MXE Octave. See: https://ftp.gnu.org/pub/gnu/readline/readline-8.2-patches/readline82-001 * src/readline-0-002-upstream.patch: Remove upstream patch for previous version. * src/readline-1-input.patch, src/readline-1-sigwinch.patch: Update patches. * src/readline-3-fd_set.patch: Add patch to guard functions that use types that aren't available on Windows. * src/gdb-1-readline-8.2.patch: Cherry-pick upstream patch. * dist-files.mk: Update files in list. diff -r efc41d530cff -r 5ef7d51c2195 dist-files.mk --- a/dist-files.mk Sat Nov 12 14:34:47 2022 +0100 +++ b/dist-files.mk Sat Nov 12 17:00:41 2022 +0100 @@ -122,6 +122,7 @@ gd.mk \ gdal-2-ucrt.patch \ gdal.mk \ + gdb-1-readline-8.2.patch \ gdb.mk \ gdcm-1-nosecapi.patch \ gdcm-2-getopt.patch \ @@ -659,12 +660,12 @@ rapidjson-1-prettywriter.patch \ rapidjson.mk \ readline-0-001-upstream.patch \ - readline-0-002-upstream.patch \ readline-1-display.patch \ readline-1-fixes.patch \ readline-1-input.patch \ readline-1-sigwinch.patch \ readline-2-event-hook.patch \ + readline-3-fd_set.patch \ readline.mk \ release-octave-1-gnulib.patch \ release-octave.mk \ diff -r efc41d530cff -r 5ef7d51c2195 src/gdb-1-readline-8.2.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/gdb-1-readline-8.2.patch Sat Nov 12 17:00:41 2022 +0100 @@ -0,0 +1,31 @@ +commit 1add37b567a7dee39d99f37b37802034c3fce9c4 +Author: Andreas Schwab +Date: Sun Mar 20 14:01:54 2022 +0100 + + Add support for readline 8.2 + + In readline 8.2 the type of rl_completer_word_break_characters changed to + include const. + +diff --git a/gdb/completer.c b/gdb/completer.c +index d3900ae2014..a51c16ac7f8 100644 +--- a/gdb/completer.c ++++ b/gdb/completer.c +@@ -36,7 +36,7 @@ + calling a hook instead so we eliminate the CLI dependency. */ + #include "gdbcmd.h" + +-/* Needed for rl_completer_word_break_characters() and for ++/* Needed for rl_completer_word_break_characters and for + rl_filename_completion_function. */ + #include "readline/readline.h" + +@@ -2011,7 +2011,7 @@ gdb_completion_word_break_characters_throw () + rl_basic_quote_characters = NULL; + } + +- return rl_completer_word_break_characters; ++ return (char *) rl_completer_word_break_characters; + } + + char * diff -r efc41d530cff -r 5ef7d51c2195 src/readline-0-001-upstream.patch --- a/src/readline-0-001-upstream.patch Sat Nov 12 14:34:47 2022 +0100 +++ b/src/readline-0-001-upstream.patch Sat Nov 12 17:00:41 2022 +0100 @@ -1,58 +1,30 @@ READLINE PATCH REPORT ===================== -Readline-Release: 8.1 -Patch-ID: readline81-001 +Readline-Release: 8.2 +Patch-ID: readline82-001 -Bug-Reported-by: Tom Tromey -Bug-Reference-ID: <875z3u9fd0.fsf@tromey.com> -Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2021-01/msg00009.html +Bug-Reported-by: Kan-Ru Chen +Bug-Reference-ID: +Bug-Reference-URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109 Bug-Description: -The code to check readline versions in an inputrc file had the sense of the -comparisons reversed. +Starting a readline application with an invalid locale specification for +LC_ALL/LANG/LC_CTYPE can cause it crash on the first call to readline. -diff -ur a/input.c b/input.c ---- a/bind.c 2020-10-26 10:03:14.000000000 -0400 -+++ b/bind.c 2021-01-18 16:38:48.000000000 -0500 -@@ -1235,5 +1235,5 @@ - else if (_rl_strnicmp (args, "version", 7) == 0) - { -- int rlversion, versionarg, op, previ, major, minor; -+ int rlversion, versionarg, op, previ, major, minor, opresult; - - _rl_parsing_conditionalized_out = 1; -@@ -1295,22 +1295,23 @@ - { - case OP_EQ: -- _rl_parsing_conditionalized_out = rlversion == versionarg; -+ opresult = rlversion == versionarg; - break; - case OP_NE: -- _rl_parsing_conditionalized_out = rlversion != versionarg; -+ opresult = rlversion != versionarg; - break; - case OP_GT: -- _rl_parsing_conditionalized_out = rlversion > versionarg; -+ opresult = rlversion > versionarg; - break; - case OP_GE: -- _rl_parsing_conditionalized_out = rlversion >= versionarg; -+ opresult = rlversion >= versionarg; - break; - case OP_LT: -- _rl_parsing_conditionalized_out = rlversion < versionarg; -+ opresult = rlversion < versionarg; - break; - case OP_LE: -- _rl_parsing_conditionalized_out = rlversion <= versionarg; -+ opresult = rlversion <= versionarg; - break; - } -+ _rl_parsing_conditionalized_out = 1 - opresult; - } - /* Check to see if the first word in ARGS is the same as the +diff -ur a/nls.c b/nls.c +--- a/nls.c 2022-08-15 09:38:51.000000000 -0400 ++++ b/nls.c 2021-01-18 2022-10-05 09:23:22.000000000 -0400 +@@ -142,4 +142,8 @@ + lspec = ""; + ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */ ++ if (ret == 0 || *ret == 0) ++ ret = setlocale (LC_CTYPE, (char *)NULL); ++ if (ret == 0 || *ret == 0) ++ ret = RL_DEFAULT_LOCALE; + #else + ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec; diff -ur a/patchlevel b/patchlevel --- a/patchlevel 2013-11-15 08:11:11.000000000 -0500 diff -r efc41d530cff -r 5ef7d51c2195 src/readline-0-002-upstream.patch --- a/src/readline-0-002-upstream.patch Sat Nov 12 14:34:47 2022 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ - READLINE PATCH REPORT - ===================== - -Readline-Release: 8.1 -Patch-ID: readline81-002 - -Bug-Reported-by: Volodymyr Prodan -Bug-Reference-ID: -Bug-Reference-URL: https://savannah.gnu.org/patch/?10076 - -Bug-Description: - -There are some characters (e.g., cyrillic) that can't be displayed using -certain single-byte encodings (e.g., cp1251) because the negative signed -int is interpreted as EOF and not displayed. - -diff -urN readline-8.1/display.c.orig readline-8.1/display.c ---- readline-8.1/display.c 2021-03-16 18:12:20.000000000 -0400 -+++ readline-8.1/display.c 2021-06-07 16:53:08.000000000 -0400 -@@ -1598,7 +1598,7 @@ - char cur_face; - - for (cur_face = FACE_NORMAL, i = 0; i < n; i++) -- putc_face (str[i], face[i], &cur_face); -+ putc_face ((unsigned char) str[i], face[i], &cur_face); - putc_face (EOF, FACE_NORMAL, &cur_face); - } - - -diff -ur a/patchlevel b/patchlevel ---- a/patchlevel 2013-11-15 08:11:11.000000000 -0500 -+++ b/patchlevel 2014-03-21 08:28:40.000000000 -0400 -@@ -1,3 +1,3 @@ - # Do not edit -- exists only for use by patch - --1 -+2 - diff -r efc41d530cff -r 5ef7d51c2195 src/readline-1-input.patch --- a/src/readline-1-input.patch Sat Nov 12 14:34:47 2022 +0100 +++ b/src/readline-1-input.patch Sat Nov 12 17:00:41 2022 +0100 @@ -1,11 +1,12 @@ diff -ur readline-8.1.1/input.c readline-8.1.2/input.c --- readline-8.1.1/input.c 2020-12-19 07:54:06.883500144 -0500 +++ readline-8.1.2/input.c 2020-12-19 07:55:29.042995655 -0500 -@@ -538,7 +538,12 @@ +@@ -819,7 +819,12 @@ #if defined (__MINGW32__) - if (isatty (fileno (stream))) +- if (isatty (fd) - return (_getch ()); /* "There is no error return." */ ++ if (isatty (fd)) + { + int c = _getch (); + if (c == 0xe0) @@ -14,4 +15,4 @@ + } #endif result = 0; - #if defined (HAVE_PSELECT) + #if defined (HAVE_PSELECT) || defined (HAVE_SELECT) diff -r efc41d530cff -r 5ef7d51c2195 src/readline-1-sigwinch.patch --- a/src/readline-1-sigwinch.patch Sat Nov 12 14:34:47 2022 +0100 +++ b/src/readline-1-sigwinch.patch Sat Nov 12 17:00:41 2022 +0100 @@ -1,18 +1,18 @@ diff -ur readline-8.1.2/readline.c readline-8.1.3/readline.c --- readline-8.1.2/readline.c 2020-12-19 07:55:06.477760951 -0500 +++ readline-8.1.3/readline.c 2020-12-19 07:56:17.722659252 -0500 -@@ -1154,8 +1154,12 @@ +@@ -1186,8 +1186,13 @@ RL_SETSTATE(RL_STATE_INITIALIZED); } else -- (void)_rl_init_locale (); /* check current locale */ -- +- _rl_reset_locale (); /* check current locale and set locale variables */ + { -+ (void)_rl_init_locale (); /* check current locale */ ++ _rl_reset_locale (); /* check current locale and set locale variables */ +#if defined (__MINGW32__) + rl_reset_screen_size (); +#endif + } + /* Initialize the current line information. */ _rl_init_line_state (); @@ -41,17 +41,6 @@ int rl_catch_sigwinch = 1; #else int rl_catch_sigwinch = 0; /* for the readline state struct in readline.c */ -@@ -266,8 +271,10 @@ - case SIGQUIT: - #endif - -+#if defined (HAVE_POSIX_SIGNALS) - if (block_sig) - sigprocmask (SIG_BLOCK, &set, &oset); -+#endif - - rl_echo_signal_char (sig); - rl_cleanup_after_signal (); @@ -532,6 +539,21 @@ } #endif /* SIGWINCH */ diff -r efc41d530cff -r 5ef7d51c2195 src/readline-3-fd_set.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/readline-3-fd_set.patch Sat Nov 12 17:00:41 2022 +0100 @@ -0,0 +1,29 @@ +Guard functions that use types that aren't available on all platforms with +pre-processor conditions. + +diff -urN readline-8.2/input.c.orig readline-8.2/input.c +--- readline-8.2/input.c.orig 2022-11-12 17:54:14.800371248 +0100 ++++ readline-8.2/input.c 2022-11-12 17:58:13.327167979 +0100 +@@ -151,7 +151,9 @@ + + int _rl_timeout_init (void); + int _rl_timeout_sigalrm_handler (void); ++#if defined (HAVE_PSELECT) || defined (HAVE_SELECT) + int _rl_timeout_select (int, fd_set *, fd_set *, fd_set *, const struct timeval *, const sigset_t *); ++#endif + + static void _rl_timeout_handle (void); + #if defined (RL_TIMEOUT_USE_SIGALRM) + +diff -urN readline-8.2/rlprivate.h.orig readline-8.2/rlprivate.h +--- readline-8.2/rlprivate.h.orig 2022-08-12 00:35:16.000000000 +0200 ++++ readline-8.2/rlprivate.h 2022-11-12 17:43:54.266291863 +0100 +@@ -303,7 +303,7 @@ + + extern int _rl_timeout_init (void); + extern int _rl_timeout_handle_sigalrm (void); +-#if defined (_POSIXSELECT_H_) ++#if defined (HAVE_PSELECT) || defined (HAVE_SELECT) + /* use as a sentinel for fd_set, struct timeval, and sigset_t definitions */ + extern int _rl_timeout_select (int, fd_set *, fd_set *, fd_set *, const struct timeval *, const sigset_t *); + #endif diff -r efc41d530cff -r 5ef7d51c2195 src/readline.mk --- a/src/readline.mk Sat Nov 12 14:34:47 2022 +0100 +++ b/src/readline.mk Sat Nov 12 17:00:41 2022 +0100 @@ -3,8 +3,8 @@ PKG := readline $(PKG)_IGNORE := -$(PKG)_VERSION := 8.1 -$(PKG)_CHECKSUM := 48c5e0c3a212449e206e21ba82856accac842c6f +$(PKG)_VERSION := 8.2 +$(PKG)_CHECKSUM := 97ad98be243a857b639c0f3da2fe7d81c6d1d36e $(PKG)_SUBDIR := readline-$($(PKG)_VERSION) $(PKG)_FILE := readline-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://ftp.gnu.org/gnu/readline/$($(PKG)_FILE)