Skip to content

Commit 63924e6

Browse files
committed
fix(mutt): fix use of regex in the glob context
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}".
1 parent 9c3e196 commit 63924e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

completions/mutt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ _comp_cmd_mutt__filedir()
136136
elif [[ $cur == !* ]]; then
137137
spoolfile="$("$muttcmd" -F "$muttrc" -Q spoolfile 2>/dev/null |
138138
command sed -e 's|^spoolfile=\"\(.*\)\"$|\1|')"
139-
[[ $spoolfile ]] && eval cur="${cur/^!/$spoolfile}"
139+
[[ $spoolfile ]] && eval cur="${cur/#!/$spoolfile}"
140140
fi
141141
_comp_compgen -c "$cur" filedir
142142
}

0 commit comments

Comments
 (0)