X-Git-Url: http://git.plutz.net/?p=cgilite;a=blobdiff_plain;f=cgilite.sh;h=e145f2eebe173be82475cde1ec60fb200a14ed63;hp=f03f74732165e4d672418d3718ecc228db4ac53d;hb=147c7222675fd027873faa7e921e2679d99e71cc;hpb=b8cec2270b5917e96f57d72c4d1ad96471cad3d3 diff --git a/cgilite.sh b/cgilite.sh index f03f747..e145f2e 100755 --- a/cgilite.sh +++ b/cgilite.sh @@ -27,6 +27,8 @@ BR=' ' cgilite_timeout=2 +debug(){ [ $# -gt 0 ] && printf '%s\n' "$@" >&2 || tee -a /dev/stderr; } + PATH(){ local str seg out [ $# -eq 0 ] && str="$(cat)" || str="$*" @@ -200,6 +202,7 @@ HTML(){ \'*) out="${out}'";; \[*) out="${out}[";; \]*) out="${out}]";; + "${CR}"*) out="${out} ";; "${BR}"*) out="${out} ";; *) out="${out}${str%"${str#?}"}";; esac @@ -222,6 +225,8 @@ URL(){ \[*) out="${out}%5B";; \]*) out="${out}%5D";; \ *) out="${out}%20";; + " "*) out="${out}%09";; + "${CR}"*) out="${out}%0D";; "${BR}"*) out="${out}%0A";; %*) out="${out}%25";; *) out="${out}${str%"${str#?}"}";;