X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=cgilite%2Fcgilite.sh;h=a0a96d1c9191ec2cf849105bd0b910dbfe62db23;hb=6e5109c4c77aed6527b6f1093e0f017a3e891c5f;hp=a2aa32924bdc7ed30cc35fb053b416859a05f93c;hpb=11a13e9ffa60bda35be07c56b0888b77fc9b6ec5;p=rawnet diff --git a/cgilite/cgilite.sh b/cgilite/cgilite.sh index a2aa329..a0a96d1 100755 --- a/cgilite/cgilite.sh +++ b/cgilite/cgilite.sh @@ -48,7 +48,9 @@ _EXEC="${_EXEC:-${0%/*}}" _DATA="${_DATA:-.}" _EXEC="${_EXEC%/}" _DATA="${_DATA%/}" _BASE="${_BASE%/}" -# Carriare Return and Line Break characters for convenience +export _EXEC _DATA _BASE + +# Carriage Return and Line Break characters for convenience CR=" " BR=' ' @@ -90,7 +92,7 @@ HEX_DECODE(){ *) out="${out}${in%"${in#?}"}"; in="${in#?}"; continue;; esac; - # Hex escaes for printf (e.g. \x41) are not portable + # Hex escapes for printf (e.g. \x41) are not portable # The portable way for Hex output is transforming Hex to Octal # (e.g. \x41 = \101) case $in in @@ -195,6 +197,8 @@ if [ "${REQUEST_METHOD}" = POST -a "${CONTENT_LENGTH:-0}" -gt 0 -a \ cgilite_post="$(head -c "$CONTENT_LENGTH")" fi +PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")" + debug(){ [ $# -gt 0 ] && printf '%s\n' "$@" >&2 || tee -a /dev/stderr; } [ "${DEBUG+x}" ] && env >&2