perf: avoid duplicate completion security audit (#13873)

This commit is contained in:
farlyfeifei 2026-08-05 19:30:21 +08:00 committed by GitHub
commit a4a224b3fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -124,9 +124,11 @@ fi
if [[ "$ZSH_DISABLE_COMPFIX" != true ]]; then
source "$ZSH/lib/compfix.zsh"
# Load only from secure directories
# Reset the flag compinit sets when -i excludes insecure entries
unset _comp_secure
compinit -i -d "$ZSH_COMPDUMP"
# If completion insecurities exist, warn the user
handle_completion_insecurities &|
[[ "$_comp_secure" == yes ]] && handle_completion_insecurities &|
else
# If the user wants it, load from all found directories
compinit -u -d "$ZSH_COMPDUMP"