b00b59364a019894ee4b9ba4062d922fedaa5ccd

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix(vcs_info): don't patch VCS_INFO_formats if not found

Diff

 1diff --git a/lib/vcs_info.zsh b/lib/vcs_info.zsh
 2index edb515ce04b28d50daa7f2e4b072d50e05f5366c..e60938c1452dd8e464366d49571a54570e3371eb 100644
 3--- a/lib/vcs_info.zsh
 4+++ b/lib/vcs_info.zsh
 5@@ -38,7 +38,7 @@
 6 # due to malicious input as a consequence of CVE-2021-45444, which affects
 7 # zsh versions from 5.0.3 to 5.8.
 8 #
 9-autoload -Uz +X regexp-replace VCS_INFO_formats
10+autoload -Uz +X regexp-replace VCS_INFO_formats 2>/dev/null || return
11 
12 # We use $tmp here because it's already a local variable in VCS_INFO_formats
13 typeset PATCH='for tmp (base base-name branch misc revision subdir) hook_com[$tmp]="${hook_com[$tmp]//\%/%%}"'