broken when directory contains files with exclamation mark (!)

Bug #1637193 reported by Valentas
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
bash-completion (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

typing vim and hitting tab displays no local files if the directory contains a file that starts with an exclamation mark. See also a question by another user http://askubuntu.com/questions/840866/vi-tab-completion-works-only-in-some-directories.

Revision history for this message
Valentas (vk-registrator) wrote :

bash-completion version: 1:2.1-4.2ubuntu1.1

Revision history for this message
Andrey Sidorov (andrey-desman) wrote :

Fixed by extra-quoting $xspec.

$ diff -u bash_completion /usr/share/bash-completion/bash_completion
--- bash_completion 2016-11-29 21:48:11.787460446 +0300
+++ /usr/share/bash-completion/bash_completion 2016-11-29 21:44:51.755183840 +0300
@@ -1845,7 +1845,7 @@
     xspec="$matchop($xspec|${xspec^^})"

     toks+=( $(
- eval compgen -f -X "!$xspec" -- "\$(quote_readline "\$cur")" | {
+ eval compgen -f -X "\'!$xspec\'" -- "\$(quote_readline "\$cur")" | {
         while read -r tmp; do
             [[ -n $tmp ]] && printf '%s\n' $tmp
         done

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash-completion (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.