1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-15 23:03:53 -05:00

ignores carriage returns

This commit is contained in:
Yamashita Yuu
2014-03-24 18:15:40 +09:00
parent d90cb0ec85
commit ea9214bb2e
2 changed files with 19 additions and 13 deletions

View File

@@ -8,14 +8,14 @@ VERSION_FILE="$1"
if [ -e "$VERSION_FILE" ]; then
# Read the first non-whitespace word from the specified version file.
# Be careful not to load it whole in case there's something crazy in it.
IFS="${IFS}"$'\r'
words=( $(cut -b 1-1024 "$VERSION_FILE") )
versions=("${words[@]}")
if [ -n "$versions" ]; then
OLDIFS="$IFS"
{ IFS=:
echo "${versions[*]}"
}
IFS=:
echo "${versions[*]}"
IFS="$OLDIFS"
exit
fi