mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 15:30:40 +01:00
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.
This commit is contained in:
@@ -428,7 +428,7 @@ function main {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Read the commit fields (@ is needed to keep empty values)
|
# 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]}"
|
hash="${raw_fields[1]}"
|
||||||
refs="${raw_fields[2]}"
|
refs="${raw_fields[2]}"
|
||||||
subject="${raw_fields[3]}"
|
subject="${raw_fields[3]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user