for n in "$@"; do case ${n%%=*} in
data) _DATA="${n#data=}";;
- exec) _exec="${n#exec=}";;
+ exec) _EXEC="${n#exec=}";;
noerr) exec 2>&-;;
esac; done
| "${_EXEC}/cgilite/html-sh.sed"
}
-if [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then
+topdir="${_PATH#/}"
+topdir="/${topdir%%/*}"
+
+if [ -d "${_EXEC}/${topdir}" -a -x "${_EXEC}/${topdir}/index.cgi" ]; then
+ . "${_EXEC}/${topdir}/index.cgi"
+elif [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then
. "${_EXEC}/${_PATH}/index.cgi"
elif [ ! -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}" ]; then
. "${_EXEC}/${_PATH}"