From bb8ddd1d7e31ccff9f1ae0d2abb124910a8ad126 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 11 Oct 2016 15:19:53 +0000 Subject: [PATCH] Bugfix: keep last post element without appending empty element svn path=/trunk/; revision=38 --- cgi.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cgi.sh b/cgi.sh index 7b5651a..206f322 100755 --- a/cgi.sh +++ b/cgi.sh @@ -38,13 +38,7 @@ if [ "$REQUEST_METHOD" = POST -a "$HTTP_CONTENT_LENGTH" -gt 0 ]; then # parse HTTP POST string debug "== CGI DATA: POST ==" head -c "$HTTP_CONTENT_LENGTH" \ - | sed -un ' - 2q - 1{ - s;&;\n;g; - a - p - }' \ + | sed -un 's;&;\n;g; p; q' \ | while read query; do key="$(printf %s "$query" |sed -r 's:^([\.a-zA-Z0-9_-]+)=(.*)$:\1:')" val="$(printf %s "$query" |sed -r 's:^([\.a-zA-Z0-9_-]+)=(.*)$:\2:')" -- 2.39.2