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: Chet Ramey
Subject: Re: [Bug-readline] directory_completion_hook interacts with tilde expansion
Date: Thu, 25 Mar 2010 15:23:48 -0400
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 3/25/10 2:29 PM, "Stefan H. Holek · Jarn" wrote:
> 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. ;-)

Yeah, that looks like a problem.  I'll take a look.  Thanks for the
report.

Chet

-- 
``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]