X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=index.cgi;h=b407fc17ea0dcf6d556dba7b5ad5df5eb91189b2;hp=fada33d28e5e7a0bcb09a2e462f5e19ce2646023;hb=9b62da2cc5552e018fe8c48360c770446a9a6b55;hpb=c4c5b0acdaaa275baa934caeeba960ad12d14c71 diff --git a/index.cgi b/index.cgi index fada33d..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,7 +74,7 @@ cgi_get [ -x "$_EXEC/constants.sh" ] && . "$_EXEC/constants.sh" -if [ -n "$_GET[\"action\"]" ]; then +if [ -n "${_GET[action]}" ]; then . "$_EXEC/shcgi/action.sh" else . "$_EXEC/shcgi/page.sh"