[Top][All Lists]

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

Re: rl_message prompt save/restore confusion with prompt=""

From: Chet Ramey
Subject: Re: rl_message prompt save/restore confusion with prompt=""
Date: Fri, 10 Mar 2023 17:50:33 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 3/6/23 6:55 PM, Grisha Levit wrote:

There is a problem though -- if readline was called with prompt="",
rl_expand_prompt will leave local_prompt set to 0 and so even if
rl_save_prompt has been called, saved_local_prompt will still == 0.

That's the problem.

Alternatively, rl_expand_prompt can be changed to not return early
with an empty prompt, thereby making local_prompt a non-null pointer
so rl_message can properly pick up on its having been saved.

It can return early, just with local_prompt as an allocated empty string.

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

reply via email to

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