[Bash-completion-devel] Bug#775661: Bug#775661: [bash-completion] odd completion candidates

Peter Cordes peter at cordes.ca
Mon Jan 19 21:07:31 UTC 2015


On Sun, Jan 18, 2015 at 10:22:20AM +0000, lumin wrote:
> Package: bash-completion
> Version: 1:2.1-4
> 
> Hi,
> 
> Accidently I found this bug/issue after typing 2 times of the TAB key.
> 
> REPLAY:
> 1. create files in a dir
> $ ll
> total 472K
> -rw-r--r-- 1 x x 201K Jan 18 10:13 linux?.0
> -rw-r--r-- 1 x x 113K Jan 18 10:13 linux?.1
> -rw-r--r-- 1 x x 151K Jan 18 10:13 linux?.2
> 
> 2. cat +{2 times of tab}
> $ cat 
> .0     .1     .2     linux  
> In fact, the same result would appear after s/cat/vim/ or
> something like that.
> 
> Maybe this is just cosmetic, but it is
> strange, isn't it?

 The progcomp code doesn't try to escape cursor-movement control or
escape codes, I don't think, but GNU ls does.  I think your filenames
are linux^M.x or something.

ls  --literal
              print raw entry names (don't treat e.g. control
characters specially)

 might give similar output to tab completion.

Did those filenames come from something that read from a DOS text
file?  Stripped off the trailing linefeed, was left with "linux^M".

 If you truncate those files (> linux*0; > linux*1; ...), and make a
tar.gz of your directory as a testcase, that might possibly be useful
for us to test progcomp with weird input.

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter at cor , des.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC



More information about the Bash-completion-devel mailing list