Skip to content

Commit 215edab

Browse files
committed
fix(kcov,povray): quote array expansions to avoid extra processing
The raw assignment can be affected by word splitting and pathname expansions.
1 parent f98379d commit 215edab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

completions/kcov

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ _comp_cmd_kcov()
3636
COMPREPLY=(${COMPREPLY/#/$prev,})
3737
else
3838
_comp_compgen -- -W "{0..100}"
39-
((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/%/,})
39+
((${#COMPREPLY[@]} == 1)) && COMPREPLY=("${COMPREPLY/%/,}")
4040
compopt -o nospace
4141
fi
4242
return

completions/povray

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ _comp_cmd_povray()
3535
IFS=$'\n'
3636
command grep '^[-+]I' <<<"${words[*]}"
3737
))
38-
COMPREPLY=(${COMPREPLY[@]#[-+]I})
39-
COMPREPLY=(${COMPREPLY[@]/%.pov/.$oext})
38+
_comp_compgen -Rv COMPREPLY -- -X '' -W '"${COMPREPLY[@]#[-+]I}"'
39+
COMPREPLY=("${COMPREPLY[@]/%.pov/.$oext}")
4040
cur="${povcur#[-+]O}" # to confuse _comp_compgen_filedir
4141
pfx="${povcur%"$cur"}"
4242
_comp_compgen -a filedir $oext

0 commit comments

Comments
 (0)