Fix failglob aborts in complete_alias

`unset sta[-1]` is an unquoted glob pattern in
__compal__split_cmd_line, so with `shopt -s failglob` it aborts
the completion whenever a split string closes quotes, parentheses,
braces, or backticks

Quote the five occurrences like the earlier `unset` fix
This commit is contained in:
Alexander Hess 2026-10-06 13:03:12 +02:00
commit ab78875746
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -375,7 +375,7 @@ __compal__split_cmd_line() {
fi
elif [[ "${sta[-1]}" == ')' ]]; then
if [[ ')' == "${str:j:1}" ]]; then
unset sta[-1]
unset 'sta[-1]'
elif [[ '$(' == "${str:j:2}" ]]; then
sta+=( ')' )
(( j++ ))
@ -394,7 +394,7 @@ __compal__split_cmd_line() {
fi
elif [[ "${sta[-1]}" == '}' ]]; then
if [[ '}' == "${str:j:1}" ]]; then
unset sta[-1]
unset 'sta[-1]'
elif [[ '$(' == "${str:j:2}" ]]; then
sta+=( ')' )
(( j++ ))
@ -413,7 +413,7 @@ __compal__split_cmd_line() {
fi
elif [[ "${sta[-1]}" == '`' ]]; then
if [[ '`' == "${str:j:1}" ]]; then
unset sta[-1]
unset 'sta[-1]'
elif [[ '$(' == "${str:j:2}" ]]; then
sta+=( ')' )
(( j++ ))
@ -430,11 +430,11 @@ __compal__split_cmd_line() {
fi
elif [[ "${sta[-1]}" == "'" ]]; then
if [[ "'" == "${str:j:1}" ]]; then
unset sta[-1]
unset 'sta[-1]'
fi
elif [[ "${sta[-1]}" == '"' ]]; then
if [[ '"' == "${str:j:1}" ]]; then
unset sta[-1]
unset 'sta[-1]'
elif [[ '$(' == "${str:j:2}" ]]; then
sta+=( ')' )
(( j++ ))