X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=index.cgi;h=b407fc17ea0dcf6d556dba7b5ad5df5eb91189b2;hb=daa2cb2e7deb218330a74e609642830de221bbf5;hp=9c068b54435e49f0d723e318b71a265f796be681;hpb=49831f4301899b008b94f590b4c9765f76b4c0f0;p=shcgi diff --git a/index.cgi b/index.cgi index 9c068b5..b407fc1 100755 --- a/index.cgi +++ b/index.cgi @@ -36,7 +36,7 @@ _EXEC="${real%/shcgi/index.cgi}" #execution directory # basic functions debug() { #change to false to disable debugging if [ "$DBG_ENABLED" = true -a -n "$*" ]; then - echo -E "$@" >>"$DBG_FILE" + printf '%s\n' "$*" >>"$DBG_FILE" elif [ "$DBG_ENABLED" = true -a -z "$*" ]; then tee -a "$DBG_FILE" elif [ -z "$*" ]; then @@ -45,8 +45,8 @@ debug() { #change to false to disable debugging } die() { - debug "$@" - echo -E "$@" >>/dev/stderr + debug FATAL: "$*" + printf '%s\n' "$*" >&2 exit 1 } @@ -74,10 +74,8 @@ cgi_get [ -x "$_EXEC/constants.sh" ] && . "$_EXEC/constants.sh" -if [ -n "$_GET[\"action\"]" ]; then +if [ -n "${_GET[action]}" ]; then . "$_EXEC/shcgi/action.sh" -elif [ -n "$_GET[\"export\"]" ]; then - . "$_EXEC/shcgi/export.sh" else . "$_EXEC/shcgi/page.sh" fi