mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2026-09-10 07:16:18 -04:00
Fix incorrect IFS handling
The echo "${VIRTUALENV_PREFIX_PATHS[*]}" statement at the end of the file
only worked by accident because IFS=: was set earlier in the file.
Properly set/unset IFS.
This commit is contained in:
parent
5ac3b3a1d9
commit
c483e44cb4
|
|
@ -26,13 +26,17 @@ if [ -z "$PYENV_ROOT" ]; then
|
|||
PYENV_ROOT="${HOME}/.pyenv"
|
||||
fi
|
||||
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
if [ -n "$1" ]; then
|
||||
versions=($@)
|
||||
IFS=: PYENV_VERSION="${versions[*]}"
|
||||
# $@ is not affected by IFS
|
||||
versions=("$@")
|
||||
PYENV_VERSION="${versions[*]}"
|
||||
export PYENV_VERSION
|
||||
else
|
||||
IFS=: versions=($(pyenv-version-name))
|
||||
versions=($(pyenv-version-name))
|
||||
fi
|
||||
IFS="$OLDIFS"
|
||||
|
||||
append_virtualenv_prefix() {
|
||||
if [ -d "${VIRTUALENV_PREFIX_PATH}" ]; then
|
||||
|
|
@ -101,4 +105,7 @@ for version in "${versions[@]}"; do
|
|||
fi
|
||||
done
|
||||
|
||||
IFS=: echo "${VIRTUALENV_PREFIX_PATHS[*]}"
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
echo "${VIRTUALENV_PREFIX_PATHS[*]}"
|
||||
IFS="$OLDIFS"
|
||||
|
|
|
|||
Loading…
Reference in a new issue