On 4/26/22 9:22 AM, Andrew Burgess wrote:

Here's a strawman patch:

## START ##

diff --git a/callback.c b/callback.c
index 1a3235f..a7b0b0b 100644
--- a/callback.c
+++ b/callback.c
@@ -279,7 +279,7 @@ rl_callback_read_char (void)
        }
/* Make sure application hooks can see whether we saw EOF. */
-      if (rl_eof_found = eof)
+      if (rl_eof_found = (rl_done && eof))
        RL_SETSTATE(RL_STATE_EOF);

I think something like this works better:

@@ -279,8 +279,11 @@
        }

       /* Make sure application hooks can see whether we saw EOF. */
-      if (rl_eof_found = eof)
-       RL_SETSTATE(RL_STATE_EOF);
+      if (eof > 0)
+       {
+         rl_eof_found = eof;
+         RL_SETSTATE(RL_STATE_EOF);
+       }

       if (rl_done)
        {



--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

Reply via email to