diff --git a/libedit-rlhandler.patch b/libedit-rlhandler.patch new file mode 100644 index 0000000..e78c297 --- /dev/null +++ b/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/libedit.spec b/libedit.spec index aa0dc9e..ba6a3c2 100644 --- a/libedit.spec +++ b/libedit.spec @@ -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.