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:
parent
764b9df417
commit
ab78875746
1 changed files with 5 additions and 5 deletions
|
|
@ -375,7 +375,7 @@ __compal__split_cmd_line() {
|
||||||
fi
|
fi
|
||||||
elif [[ "${sta[-1]}" == ')' ]]; then
|
elif [[ "${sta[-1]}" == ')' ]]; then
|
||||||
if [[ ')' == "${str:j:1}" ]]; then
|
if [[ ')' == "${str:j:1}" ]]; then
|
||||||
unset sta[-1]
|
unset 'sta[-1]'
|
||||||
elif [[ '$(' == "${str:j:2}" ]]; then
|
elif [[ '$(' == "${str:j:2}" ]]; then
|
||||||
sta+=( ')' )
|
sta+=( ')' )
|
||||||
(( j++ ))
|
(( j++ ))
|
||||||
|
|
@ -394,7 +394,7 @@ __compal__split_cmd_line() {
|
||||||
fi
|
fi
|
||||||
elif [[ "${sta[-1]}" == '}' ]]; then
|
elif [[ "${sta[-1]}" == '}' ]]; then
|
||||||
if [[ '}' == "${str:j:1}" ]]; then
|
if [[ '}' == "${str:j:1}" ]]; then
|
||||||
unset sta[-1]
|
unset 'sta[-1]'
|
||||||
elif [[ '$(' == "${str:j:2}" ]]; then
|
elif [[ '$(' == "${str:j:2}" ]]; then
|
||||||
sta+=( ')' )
|
sta+=( ')' )
|
||||||
(( j++ ))
|
(( j++ ))
|
||||||
|
|
@ -413,7 +413,7 @@ __compal__split_cmd_line() {
|
||||||
fi
|
fi
|
||||||
elif [[ "${sta[-1]}" == '`' ]]; then
|
elif [[ "${sta[-1]}" == '`' ]]; then
|
||||||
if [[ '`' == "${str:j:1}" ]]; then
|
if [[ '`' == "${str:j:1}" ]]; then
|
||||||
unset sta[-1]
|
unset 'sta[-1]'
|
||||||
elif [[ '$(' == "${str:j:2}" ]]; then
|
elif [[ '$(' == "${str:j:2}" ]]; then
|
||||||
sta+=( ')' )
|
sta+=( ')' )
|
||||||
(( j++ ))
|
(( j++ ))
|
||||||
|
|
@ -430,11 +430,11 @@ __compal__split_cmd_line() {
|
||||||
fi
|
fi
|
||||||
elif [[ "${sta[-1]}" == "'" ]]; then
|
elif [[ "${sta[-1]}" == "'" ]]; then
|
||||||
if [[ "'" == "${str:j:1}" ]]; then
|
if [[ "'" == "${str:j:1}" ]]; then
|
||||||
unset sta[-1]
|
unset 'sta[-1]'
|
||||||
fi
|
fi
|
||||||
elif [[ "${sta[-1]}" == '"' ]]; then
|
elif [[ "${sta[-1]}" == '"' ]]; then
|
||||||
if [[ '"' == "${str:j:1}" ]]; then
|
if [[ '"' == "${str:j:1}" ]]; then
|
||||||
unset sta[-1]
|
unset 'sta[-1]'
|
||||||
elif [[ '$(' == "${str:j:2}" ]]; then
|
elif [[ '$(' == "${str:j:2}" ]]; then
|
||||||
sta+=( ')' )
|
sta+=( ')' )
|
||||||
(( j++ ))
|
(( j++ ))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue