bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] rl_complete() issue due to function pointer compariso


From: Chet Ramey
Subject: Re: [Bug-readline] rl_complete() issue due to function pointer comparisons and PLT trampolines
Date: Fri, 27 Mar 2015 11:03:36 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 3/27/15 10:44 AM, Ulf Magnusson wrote:
> Hello,
> 
> I noticed that rl_bind_key('\t', rl_complete) causes completion to
> break even though rl_complete is already the default binding for '\t'.
> As a trivial example, pressing TAB multiple times will not list all
> the matches when doing
> 
>     rl_bind_key('\t', rl_complete);
>     readline(">");
> 
> I think the issue is this comparison in complete.c:
> 
>     else if (rl_last_func == rl_complete && !completion_changed_buffer)
> 
> When libreadline.so.6 is loaded at startup, rl_complete in the client
> refers to a dynamic library trampoline in the PLT that in turn calls
> the "real" rl_complete. Within the library, rl_complete always refers
> to the real function. Therefore, they do not compare equal.

There's not a lot we can do about this; it's the fault of the dynamic
linker.

I am surprised that rl_complete doesn't bind to the library's version
(the `real' function) by the time rl_last_func is set, but I suppose it
just uses whatever's in the keymap.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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