If this isn't done, we end up with empty variables where previously they
were unset. This is especially bad for PYTHONPATH, which will pick
`site.py' out of the current directory.
# --- Add elements to a path string ---
__mdw_addto () {
# --- Add elements to a path string ---
__mdw_addto () {
- local var=$1 val dir=$2 new=""
+ local var=$1 val dir=$2 new="" change=nil
eval "val=\$$var"
shift 2
for i in "$@"; do
eval "val=\$$var"
shift 2
for i in "$@"; do
[ -d $i ] || continue
case "X$val" in
X)
[ -d $i ] || continue
case "X$val" in
X)
done
case $dir in
l) val=${new#:}:$val;;
r) val=$val$new;;
esac
done
case $dir in
l) val=${new#:}:$val;;
r) val=$val$new;;
esac
+ case $change in t) export $var=$val ;; esac
}
# --- Set the path variable ---
}
# --- Set the path variable ---