bug-readline
[Top][All Lists]
Advanced

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

Re: [Bug-readline] directory_completion_hook interacts with tilde expans


From: Stefan H. Holek · Jarn
Subject: Re: [Bug-readline] directory_completion_hook interacts with tilde expansion
Date: Thu, 25 Mar 2010 19:29:02 +0100

Not so fast!

I have a custom dequoting function that performs backslash-dequoting, and I *must* install it as a directory_completion_hook as well, or I'd be unable to complete paths like 'funny\ dir/foo'.

The culprit appears to be this: While the filename_dequoting_function results are assigned to 'user_dirname', opendir is called with 'dirname', effectively receiving a still quoted directory name.

The rl_filename_completion_function again:

if (rl_directory_completion_hook && (*rl_directory_completion_hook) (&dirname))
        {
          free (users_dirname);
          users_dirname = savestring (dirname);
        }
else if (rl_completion_found_quote && rl_filename_dequoting_function)
        {
temp = (*rl_filename_dequoting_function) (users_dirname, rl_completion_quote_character);
          free (users_dirname);
          users_dirname = temp;
        }
      directory = opendir (dirname); /* <-- STILL QUOTED! */

I fear you are going to tell me it's by design again, but I fail to see how this is useful behavior - yet. ;-)

Thanks,
Stefan


On 18.03.2010, at 13:50, Stefan H. Holek wrote:

Ok :-)

--
Stefan H. Holek
www.jarn.com/stefan





reply via email to

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