Skip to content

Commit

Permalink
fix(mutt): fix use of regex in the glob context
Browse files Browse the repository at this point in the history
The construct "${cur/^!/$spoolfile}" appears to try to replace the
beginning `!` with "$spoolfile" because cur starts with `!` in this
context.  However, this does not work because ^ does not mean the
beginning of the string.  We may instead use "${cur/#!/$spoolfile}".
  • Loading branch information
akinomyoga committed Dec 24, 2023
1 parent 9c3e196 commit 63924e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion completions/mutt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ _comp_cmd_mutt__filedir()
elif [[ $cur == !* ]]; then
spoolfile="$("$muttcmd" -F "$muttrc" -Q spoolfile 2>/dev/null |
command sed -e 's|^spoolfile=\"\(.*\)\"$|\1|')"
[[ $spoolfile ]] && eval cur="${cur/^!/$spoolfile}"
[[ $spoolfile ]] && eval cur="${cur/#!/$spoolfile}"
fi
_comp_compgen -c "$cur" filedir
}
Expand Down

0 comments on commit 63924e6

Please sign in to comment.