]> git.ipfire.org Git - thirdparty/readline.git/commitdiff
Readline-8.3 patch 1: fix for readline event hook master
authorChet Ramey <chet.ramey@case.edu>
Fri, 11 Jul 2025 15:51:15 +0000 (11:51 -0400)
committerChet Ramey <chet.ramey@case.edu>
Fri, 11 Jul 2025 15:51:15 +0000 (11:51 -0400)
input.c
patchlevel

diff --git a/input.c b/input.c
index e6a39e26b64a75aee21138a85d27132e9261502e..3383edb678a99593b935ccc5d2f86b869ef45198 100644 (file)
--- 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
 
index d8c9df7e6bb19b63a7c7f1c4f192a91529e40699..fdf474049fce8501d87e7b8fa7cf2b72cab0ad9b 100644 (file)
@@ -1,3 +1,3 @@
 # Do not edit -- exists only for use by patch
 
-0
+1