From b71771eaaf79d850915557ca75f397ba3aa2d099 Mon Sep 17 00:00:00 2001 From: AlmaLinux RelEng Bot Date: Mon, 30 Mar 2026 10:39:38 -0400 Subject: [PATCH] import CS libedit-3.1-39.20210216cvs.el9 --- SOURCES/libedit-rlhandler.patch | 37 +++++++++++++++++++++++++++++++++ SPECS/libedit.spec | 7 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 SOURCES/libedit-rlhandler.patch diff --git a/SOURCES/libedit-rlhandler.patch b/SOURCES/libedit-rlhandler.patch new file mode 100644 index 0000000..e78c297 --- /dev/null +++ b/SOURCES/libedit-rlhandler.patch @@ -0,0 +1,37 @@ +commit 5b29c678702d6e9e8fde48eb9f638dcb4267c212 +Author: christos +Date: Sat Aug 21 12:38:56 2021 +0000 + + PR/56370: mirabilos: libedit change from 2017 kills history in gdb + +diff --git a/lib/libedit/readline.c b/lib/libedit/readline.c +index cbae11f5a21..f4219bb3fb3 100644 +--- a/src/readline.c ++++ b/src/readline.c +@@ -2078,6 +2078,7 @@ rl_callback_read_char(void) + const char *buf = el_gets(e, &count); + char *wbuf; + ++ el_set(e, EL_UNBUFFERED, 1); + if (buf == NULL || count-- <= 0) + return; + if (count == 0 && buf[0] == e->el_tty.t_c[TS_IO][C_EOF]) +@@ -2093,7 +2094,6 @@ rl_callback_read_char(void) + } else + wbuf = NULL; + (*(void (*)(const char *))rl_linefunc)(wbuf); +- el_set(e, EL_UNBUFFERED, 1); + } + } + +@@ -2111,9 +2111,8 @@ rl_callback_handler_install(const char *prompt, rl_vcpfunc_t *linefunc) + void + rl_callback_handler_remove(void) + { ++ el_set(e, EL_UNBUFFERED, 0); + rl_linefunc = NULL; +- el_end(e); +- e = NULL; + } + + void diff --git a/SPECS/libedit.spec b/SPECS/libedit.spec index aa0dc9e..98c3eba 100644 --- a/SPECS/libedit.spec +++ b/SPECS/libedit.spec @@ -4,7 +4,7 @@ Summary: The NetBSD Editline library Name: libedit Version: 3.1 -Release: 38.%{snap}cvs%{?dist} +Release: 39.%{snap}cvs%{?dist} License: BSD URL: https://www.thrysoee.dk/editline/ Source0: https://www.thrysoee.dk/editline/%{name}-%{snap}-%{version}.tar.gz @@ -15,6 +15,8 @@ BuildRequires: ncurses-devel # Fix reading of $HOME/.editrc and $EDITRC Patch1: libedit-editrc.patch +# Fix removing of readline callback handler +Patch2: libedit-rlhandler.patch %description Libedit is an autotool- and libtoolized port of the NetBSD Editline library. @@ -67,6 +69,9 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man3/history.3* %{_includedir}/editline/readline.h %changelog +* Thu Jan 15 2026 Miroslav Lichvar 3.1-39.20210216cvs +- Fix removing of readline callback handler (RHEL-133732) + * Wed Jul 19 2023 Miroslav Lichvar 3.1-38.20210216cvs - Fix reading of $HOME/.editrc and $EDITRC (#2211207)