[Bash-completion-devel] Bug#615134: Bug#615134: mutt: does not complete any aliases anymore

Helmut Grohne helmut at subdivi.de
Sat Jun 11 09:24:24 UTC 2011


On Sat, Jun 11, 2011 at 11:44:11AM +0300, Ville Skyttä wrote:
> No worries, I'll stop trying to help with this issue right now.  I'm not
> a mutt nor a Debian user, perhaps there's someone else who is at least
> one of those interested in looking into this further.

Well this is technically a regression. A regression has an obvious
solution: revert. If there is is no better solution, then revert is the
solution.

In any case your proposed hunk does not improve the situation. It was:

--- a/completions/mutt
+++ b/completions/mutt
@@ -63,3 +63,3 @@ _muttconffiles()
         for file in "${newconffiles[@]}"; do
-            __expand_tilde_by_ref file
+            eval file="$file"
             [[ ! -f "$file" || "${sofar/ ${file} / }" != "$sofar" ]] &&

The idea with eval however was good. So how about this (tested) hunk?

--- a/completions/mutt
+++ b/completions/mutt
@@ -63,3 +63,3 @@ _muttconffiles()
         for file in "${newconffiles[@]}"; do
+             file="$(eval echo $file)"
             __expand_tilde_by_ref file
             [[ ! -f "$file" || "${sofar/ ${file} / }" != "$sofar" ]] &&

In the beginning of the for loop $file is a quoted string, the eval
removes the quotes and the __expand_tilde_by_ref expands the tilde
(since $file is no longer quoted).

On the down side I suspect that this would introduce new problems with
filenames containing spaces, backslashes or dollar signs. Additionally I
always have a bad feeling evaluating random strings from random files.
What are the security implications?

Helmut





More information about the Bash-completion-devel mailing list