commit dcf5ae650b95874d9b7524ece43f6c06c7e222dd parent 366a11678582f7c430670ca7495aa7ebe67db120 Author: uriel@engel.se.cat-v.org <unknown> Date: Fri, 26 Sep 2008 11:09:18 +0200 Syntax fix and other minnor improvements Diffstat:
M | bin/cgilib.rc | | | 11 | +++++++---- |
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git 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} }