import CS libedit-3.1-39.20210216cvs.el9

This commit is contained in:
AlmaLinux RelEng Bot 2026-03-30 10:39:38 -04:00
parent 7a5ec3e65d
commit b71771eaaf
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,37 @@
commit 5b29c678702d6e9e8fde48eb9f638dcb4267c212
Author: christos <christos@NetBSD.org>
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

View File

@ -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 <mlichvar@redhat.com> 3.1-39.20210216cvs
- Fix removing of readline callback handler (RHEL-133732)
* Wed Jul 19 2023 Miroslav Lichvar <mlichvar@redhat.com> 3.1-38.20210216cvs
- Fix reading of $HOME/.editrc and $EDITRC (#2211207)