bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Readline-8.2-beta available


From: Andrew Burgess
Subject: Re: Readline-8.2-beta available
Date: Sat, 30 Apr 2022 10:41:39 +0100

Chet Ramey <chet.ramey@case.edu> 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

[Prev in Thread] Current Thread [Next in Thread]