.profile: addpath fix with empty PATHs

master
Pierre Neidhardt 2013-07-25 20:56:05 +02:00
parent 0b25241697
commit d3d829c89d
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ DUMMY=${DUMMY}:res
addpath()
{
[ $# -eq 2 ] && PATHVAR=$2 || PATHVAR=PATH
if [ -z "$PATHVAR" ]; then
if [ -z "$(eval echo \$$PATHVAR)" ]; then
eval export $PATHVAR="$1"
elif [ -z "$(eval echo \$$PATHVAR | grep "\(:\|^\)$1\(:\|$\)")" ]; then
eval export $PATHVAR="\$$PATHVAR:$1"