[Bash-completion-devel] Bug#547349: [bash-completion] "quote_readline" doubles backslashs

Lars Kruse devel at sumpfralle.de
Mon Sep 21 21:56:37 UTC 2009


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:
 lars at erker:~$ quote_readline "foo\ "
 'foo\\ '
 lars at erker:~$ dequote "$(quote_readline "foo\ ")"
 foo\\ 
(two backslashs instead of one)

In contrast the combination dequote/quote works as expected:
 lars at erker:~$ quote "foo\ "
 'foo\ '
 lars at 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20090921/fd107253/attachment.pgp>


More information about the Bash-completion-devel mailing list