Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug where IFS shell var would get set to empty string #427

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion cmake/templates/setup.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,25 @@ CATKIN_SHELL=$CATKIN_SHELL "$_SETUP_UTIL" $@ > $_SETUP_TMP
_RM=`which rm`
$_RM $_SETUP_TMP

# source all environment hooks
# Save value of IFS, including if it was unset.
# (the "+x" syntax helps differentiate unset from empty string)
if [ -z ${IFS+x} ]; then
_IFS_WAS_UNSET=1
fi
_IFS=$IFS

# source all environment hooks
IFS=":"
for _envfile in $_CATKIN_ENVIRONMENT_HOOKS; do
IFS=$_IFS
. "$_envfile"
done

# Restore value of IFS, including if it was unset
IFS=$_IFS
if [ $_IFS_WAS_UNSET ]; then
unset IFS
fi
unset _IFS_WAS_UNSET
unset _IFS
unset _CATKIN_ENVIRONMENT_HOOKS