Skip to content

Commit

Permalink
Add \r to IFS instead of removing it manually
Browse files Browse the repository at this point in the history
  • Loading branch information
genezys committed Mar 21, 2014
1 parent f205ec8 commit b025dfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libexec/rbenv-version-file-read
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ 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") )
version="${words[0]//$'\r'}"
version="${words[0]}"

if [ -n "$version" ]; then
echo "$version"
Expand Down

0 comments on commit b025dfc

Please sign in to comment.