bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `complete -d cd' does not work for dirs with a ' char


From: Chet Ramey
Subject: Re: `complete -d cd' does not work for dirs with a ' char
Date: Fri, 25 Apr 2014 15:41:28 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 4/23/14, 11:21 PM, Clark Wang wrote:
> See following example with bash-4.3.11:
> 
> [STEP 101] $ mkdir -p "foo's dir/dir1/dir2"
> [STEP 102] $ complete -d cd
> [STEP 103] $ cd <TAB>
> [STEP 103] $ cd foo\'s\ dir/<TAB>
> 
> The 1st <TAB> worked fine but the 2nd failed to work. Bash 4.2.47 and 4.1.9
> behaved the same.

Thanks for the report.  The problem is that in this case, the directory
name is dequoted twice.  In most cases, it doesn't matter, but it will
fail if the directory name has a backslash-quoted quote, as in your
example.

The attached patch will fix it.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/

Attachment: complete-dequoting.patch
Description: Source code patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]