[Top][All Lists]

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

[Bug-readline] rl_complete() issue due to function pointer comparisons a

From: Ulf Magnusson
Subject: [Bug-readline] rl_complete() issue due to function pointer comparisons and PLT trampolines
Date: Fri, 27 Mar 2015 15:44:24 +0100


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

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.

x86_64/Ubuntu 14.10/GCC 4.9.1


reply via email to

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