# but allow them to be specified in setenv.sh, in rare case when it is needed.
CLASSPATH=
-if [ -r "$CATALINA_BASE"/bin/setenv.sh ]; then
- . "$CATALINA_BASE"/bin/setenv.sh
-elif [ -r "$CATALINA_HOME"/bin/setenv.sh ]; then
- . "$CATALINA_HOME"/bin/setenv.sh
+SETENVPATH="${CATALINA_BASE:-$CATALINA_HOME}"
+if [ -r "$SETENVPATH/bin/setenv.sh" ]; then
+ . "$SETENVPATH/bin/setenv.sh"
+elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then
+ . "$CATALINA_HOME/bin/setenv.sh"
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched