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



_______________________________________________
Bug-readline mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-readline

Reply via email to