wildcard incorrect completion
Bug #1387057 reported by
Rolf Leggewie
This bug affects 7 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash-completion (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
steps to reproduce (verified on trusty)
$ touch /tmp/file01.
$ file /tmp/fileTAB
file01.txt file02.txt
$ file /tmp/file*TAB
the last command will then incorrectly complete to
$ file /tmp/file01.txt
Changed in bash-completion (Ubuntu): | |
importance: | Undecided → Medium |
To post a comment you must log in.
The problem is a lack of quoting in /usr/share/ bash_completion /bash_completio n.
set -x revealed where the problem happens: in a compgen -X -f. $quoted is used without quotes, so it expands, and you get the first of however many glob expansions.
There are two unquoted uses of $quoted in _filedir(). Fixing them fixed my tab-expanding-globs problem.
Don't forget to apply the fix for bug 1390061, too. Another case of lack of quoting leading to code that doesn't do what was intended.