#766163 bash-completion: _tilde calls compgen w/o "--" argument protection

#766163#5
Date:
2014-10-21 09:22:49 UTC
From:
To:
Hi,

when tilde-expanding in function _tilde(), the following line

  COMPREPLY=( $( compgen -P '~' -u "${1#\~}" ) )

does not protect $1 by preceding it with "--", which means that if $1 starts
with ~- (the $OLDPWD tilde-prefix), compgen will try to interpret characters
after the - as options.

Example: tab-completion of of "mv ~-o":

  $ mv ~-obash: compgen: -o: option requires an argument
  compgen: usage: compgen [-abcdefgjksuv] ...

Nothing too terrible, but still ugly, and easily fixed.

Thanks and have a nice day,
Nikolaus

#766163#10
Date:
2014-11-01 19:51:37 UTC
From:
To:
This and a bunch of other similar ones are now fixed upstream:
http://anonscm.debian.org/cgit/bash-completion/bash-completion.git/commit/?id=882649b