From: Paul Hänsch Date: Wed, 8 Jan 2020 00:58:45 +0000 (+0100) Subject: script selection priority X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=5908d44ebd530cdc8c604a0f7dea757400e33cfe;p=lobster script selection priority --- diff --git a/index.cgi b/index.cgi index b52ba72..57de236 100755 --- a/index.cgi +++ b/index.cgi @@ -54,15 +54,15 @@ yield_page() { 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 +if [ -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}" elif [ ! -x "${_EXEC}/${_PATH}" -a -r "${_EXEC}/${_PATH}" ]; then . "$_EXEC/cgilite/file.sh" FILE "${_EXEC}/${_PATH}" +elif [ -d "${_EXEC}/${topdir}" -a -x "${_EXEC}/${topdir}/index.cgi" ]; then + . "${_EXEC}/${topdir}/index.cgi" else printf 'Status: 404 Not Found\r\nContent-Length: 0\r\n\r\n' fi