diff options
author | Marc Cornellà <hello@mcornella.com> | 2021-10-27 10:12:23 +0200 |
---|---|---|
committer | Marc Cornellà <hello@mcornella.com> | 2021-10-27 10:12:23 +0200 |
commit | 1dba1120410280699c6a97a5252bab24681b46b8 (patch) | |
tree | ab1174a00693f7f49d5e3dbb97252493208eaaf1 | |
parent | 4b3a5c54117fa8af12878d1b659c14214cb4bbec (diff) | |
download | zsh-1dba1120410280699c6a97a5252bab24681b46b8.tar.gz zsh-1dba1120410280699c6a97a5252bab24681b46b8.tar.bz2 zsh-1dba1120410280699c6a97a5252bab24681b46b8.zip |
fix(changelog): fix for `${(@ps:$sep:)var}` construct in zsh < 5.0.8
In recent zsh versions, `${(@ps:$sep:)var}` where $sep is a variable containing
a separator string and $var is a string with multiple values separated by $sep,
the `p` flag makes zsh correctly expand $sep before splitting $var. In versions
older than 5.0.8, this doesn't happen, so we use `eval` to get the same effect.
-rwxr-xr-x | tools/changelog.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/changelog.sh b/tools/changelog.sh index e32d503b1..664f34608 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -428,7 +428,7 @@ function main { fi # Read the commit fields (@ is needed to keep empty values) - raw_fields=("${(@ps:$SEP:)raw_commit}") + eval "raw_fields=(\"\${(@ps:$SEP:)raw_commit}\")" hash="${raw_fields[1]}" refs="${raw_fields[2]}" subject="${raw_fields[3]}" |