readline: backport a patch to fix issue that readline can't work with samba

smbclient can't accept input after readline upgrade to 8.3
| root # smbclient //192.168.2.16/test -N
|       Try "help" to get a list of possible commands.
|       smb: \>

similar issue has been reported:
https://lists.gnu.org/archive/html/bug-readline/2025-07/msg00011.html

(From OE-Core rev: e2478467b45ed2a80c32a7ee0a673555a3c98bf5)

Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Liu Yiding
2025-08-27 11:05:16 +08:00
committed by Richard Purdie
parent d0403b973f
commit 7001bdc3d7
2 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
From 15970c431517a046099d8294c91d778b1da9b29d Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 11 Jul 2025 11:51:15 -0400
Subject: Readline-8.3 patch 1: fix for readline event hook
Upstream-Status: Backport [https://cgit.git.savannah.gnu.org/cgit/readline.git/commit/?id=15970c431517a046099d8294c91d778b1da9b29d]
Signed-off-by: Chet Ramey <chet.ramey@case.edu>
---
input.c | 6 +++++-
patchlevel | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/input.c b/input.c
index e6a39e2..3383edb 100644
--- a/input.c
+++ b/input.c
@@ -261,13 +261,16 @@ rl_gather_tyi (void)
input = 0;
tty = fileno (rl_instream);
- /* Move this up here to give it first shot, but it can't set chars_avail */
+ /* Move this up here to give it first shot, but it can't set chars_avail,
+ so we assume a single character is available. */
/* XXX - need rl_chars_available_hook? */
if (rl_input_available_hook)
{
result = (*rl_input_available_hook) ();
if (result == 0)
result = -1;
+ else
+ chars_avail = 1;
}
#if defined (HAVE_PSELECT) || defined (HAVE_SELECT)
@@ -285,6 +288,7 @@ rl_gather_tyi (void)
#endif
if (result <= 0)
return 0; /* Nothing to read. */
+ result = -1; /* there is something, so check how many chars below */
}
#endif
diff --git a/patchlevel b/patchlevel
index d8c9df7..fdf4740 100644
--- a/patchlevel
+++ b/patchlevel
@@ -1,3 +1,3 @@
# Do not edit -- exists only for use by patch
-0
+1
--
cgit v1.2.3

View File

@@ -1,6 +1,7 @@
require readline.inc
SRC_URI += "file://norpath.patch \
file://fix-for-readline-event-hook.patch \
"
SRC_URI[archive.sha256sum] = "fe5383204467828cd495ee8d1d3c037a7eba1389c22bc6a041f627976f9061cc"