diff options
author | Carlo Sala <carlosalag@protonmail.com> | 2022-04-19 19:23:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-19 19:23:54 +0200 |
commit | a26d72baa27a46cfd2f35afa789529dccf7fc212 (patch) | |
tree | af0ed763e76647d0ca3a3753bb50777f9f640ae9 | |
parent | 51555fc4b3abad57784da98d920a3369f558c480 (diff) | |
download | zsh-a26d72baa27a46cfd2f35afa789529dccf7fc212.tar.gz zsh-a26d72baa27a46cfd2f35afa789529dccf7fc212.tar.bz2 zsh-a26d72baa27a46cfd2f35afa789529dccf7fc212.zip |
fix(init): check for unsafe directories in `fpath` (#10672)
-rw-r--r-- | oh-my-zsh.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index ab32ee9d3..925ee46aa 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -120,17 +120,18 @@ fi if [[ "$ZSH_DISABLE_COMPFIX" != true ]]; then source "$ZSH/lib/compfix.zsh" - # If completion insecurities exist, warn the user - handle_completion_insecurities # Load only from secure directories - compinit -i -C -d "$ZSH_COMPDUMP" + compinit -i -d "$ZSH_COMPDUMP" + # If completion insecurities exist, warn the user + handle_completion_insecurities &| else # If the user wants it, load from all found directories - compinit -u -C -d "$ZSH_COMPDUMP" + compinit -u -d "$ZSH_COMPDUMP" fi # Append zcompdump metadata if missing -if (( $zcompdump_refresh )); then +if (( $zcompdump_refresh )) \ + || ! command grep -q -Fx "$zcompdump_revision" "$ZSH_COMPDUMP" 2>/dev/null; then # Use `tee` in case the $ZSH_COMPDUMP filename is invalid, to silence the error # See https://github.com/ohmyzsh/ohmyzsh/commit/dd1a7269#commitcomment-39003489 tee -a "$ZSH_COMPDUMP" &>/dev/null <<EOF |