From 272840da52436a32147aac332d95473d13225f16 Mon Sep 17 00:00:00 2001 From: Uriel Date: Fri, 26 Sep 2008 11:09:18 +0200 Subject: [PATCH] Syntax fix and other minnor improvements --- bin/cgilib.rc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/cgilib.rc b/bin/cgilib.rc index 93ed42c..d7103c0 100644 --- a/bin/cgilib.rc +++ b/bin/cgilib.rc @@ -10,13 +10,13 @@ Location: '^$1^' exit } -fn setvars { +fn get_post_args { ifs='& ' for(pair in `{cat}) { pair = `{echo -n $pair | sed 's/=/\&/'} \ ifs=() \ if(~ $pair(1) $*) - eval $pair(1)'=`{urldecode $pair(2)}' + $pair(1) = `{urldecode $pair(2)} } } @@ -36,6 +36,9 @@ fn template { template.awk $* | rc $rcargs } # .rec parsing fn parse_rec { - sed 's/% *//; /^$/q' < $1 - sed -n '/^$/,$p' < $1 + for(i in `{sed 's/% *//; /^$/q' < $1}) { + v = `{echo $i | sed 's/^/rec_/; s/=.*//;'} + $v = `{echo $i | sed + } + rec_data = `{sed -n '/^$/,$p' < $1} }