[Bash-completion-devel] Directory name completion fails if name contains spaces and is quoted

David Paleino d.paleino at gmail.com
Sun May 11 15:26:34 UTC 2008


tags 474094 confirmed patch
thanks

Hi Jake, hi Morita,

On Thu, 3 Apr 2008 12:38:01 +0300, Jake K wrote:

> Completion fails if  directory name contains spaces and is quoted: [..]


On Fri, 02 May 2008 13:22:11 +0900, Morita Sho wrote:

> Today I installed bash-completion and I got same bug.
> [..]
> After some investigation for /etc/bash_completion,
> I found the function _get_cword() has a problem.
> 
> The function _get_cword() was originally introduced to fix following bug in
> ubuntu: Bug #139666 in bash-completion (Ubuntu): “bash completion doesn't work
> in the middle of a word”
> https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/139666
> 
> The function _get_cword() returns the current word that cursor is pointed.
> The problem is, _get_cword considers only \ quoting, not considers " or '
> quoting. So that, _get_cword thinks the word  "foo b  is 2 words, '"foo' and
> 'b'. That is a reason why " or ' quoting not work although \ quoting works.
> 
> 
> I have 2 ideas to fix the problem. [..]

Thanks for the report, and thanks Morita for the ideas posted.
We (the Bash-Completion Team, CCed) have taken upstream development, and we're
currently working on a new release (which is mainly bug-fix).

Morita, you can have a look at what _get_cword looks like at our Bzr
repository [0]. That is the result of a merge of Ubuntu's, Debian's and
upstream's code. I'm currently looking for a way to merge your code with this,
but it won't be that simple ;) -- jokes aside, I believe we *really* need to
clean up that code a bit.

In the meanwhile, I'll wait for the response of other Bash-Completion
developers.

Thanks for the patch (and the report),
David

[0] $ bzr co http://bzr.debian.org/bash-completion/current/ bash-completion

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/bash-completion-devel/attachments/20080511/a4a4f86e/attachment-0001.pgp 


More information about the Bash-completion-devel mailing list