Chet Ramey <[email protected]> writes:

> 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)
>       {
>
>

Thanks.  Your solution fixes the issue I was seeing in GDB.

I did consider something like this, but because I didn't really
understand the negative return values I wasn't sure if this was the
right way to go.

Your description (in the other email) clears things up nicely, so thanks
again.

Thanks for the quick response.

Andrew


Reply via email to