Package: bash-completion
Version: 1:1.0-3

--- Please enter the report below this line. ---

Hi,

the function "quote_readline" seems to cause this behavior.

How to reproduce:
 mkdir "foo bar"
 mv foo\ <TAB>
this produces no resulting matches.

bash-completion uses the function "_longopt" in /etc/bash-completion for this
operation. The problem seems to be caused by the output of "quote_readline"
which is called within "_filedir", which is called by "_longopt".

Running dequote/quote_readline does not recover the original input:
 l...@erker:~$ quote_readline "foo\ "
 'foo\\ '
 l...@erker:~$ dequote "$(quote_readline "foo\ ")"
 foo\\ 
(two backslashs instead of one)

In contrast the combination dequote/quote works as expected:
 l...@erker:~$ quote "foo\ "
 'foo\ '
 l...@erker:~$ dequote "$(quote "foo\ ")"
 foo\ 
(one backslash as expected)


I could not understand the difference between "quote" and "quote_readline". But
in the case shown above, "quote" would not cause a problem, while
"quote_readline" does.

Maybe "_filedir" (and "_filedir_xpsec") should use "quote" instead of
"quote_readline"?

thanks for your work,
Lars

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.30-1-686

Debian Release: squeeze/sid
  990 testing         localhost 

--- Package information. ---
Depends          (Version) | Installed
==========================-+-===============
bash        (>= 3.1dfsg-9) | 4.0-4


Package's Recommends field is empty.

Package's Suggests field is empty.


-- 

gpg key: https://systemausfall.org/schluessel/lars-devel.0.asc

Attachment: signature.asc
Description: PGP signature

Reply via email to