Skip to content

Commit

Permalink
fix(kcov,povray): quote array expansions to avoid extra processing
Browse files Browse the repository at this point in the history
The raw assignment can be affected by word splitting and pathname
expansions.
  • Loading branch information
akinomyoga committed Dec 24, 2023
1 parent f98379d commit 215edab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion completions/kcov
Expand Up @@ -36,7 +36,7 @@ _comp_cmd_kcov()
COMPREPLY=(${COMPREPLY/#/$prev,})
else
_comp_compgen -- -W "{0..100}"
((${#COMPREPLY[@]} == 1)) && COMPREPLY=(${COMPREPLY/%/,})
((${#COMPREPLY[@]} == 1)) && COMPREPLY=("${COMPREPLY/%/,}")
compopt -o nospace
fi
return
Expand Down
4 changes: 2 additions & 2 deletions completions/povray
Expand Up @@ -35,8 +35,8 @@ _comp_cmd_povray()
IFS=$'\n'
command grep '^[-+]I' <<<"${words[*]}"
))
COMPREPLY=(${COMPREPLY[@]#[-+]I})
COMPREPLY=(${COMPREPLY[@]/%.pov/.$oext})
_comp_compgen -Rv COMPREPLY -- -X '' -W '"${COMPREPLY[@]#[-+]I}"'
COMPREPLY=("${COMPREPLY[@]/%.pov/.$oext}")
cur="${povcur#[-+]O}" # to confuse _comp_compgen_filedir
pfx="${povcur%"$cur"}"
_comp_compgen -a filedir $oext
Expand Down

0 comments on commit 215edab

Please sign in to comment.