From 361bb55f01ba28960a8127b0a16c1e7a7a8de61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 17 Sep 2021 20:57:05 +0200 Subject: Rewrite mktpl script in C The Perl version didn't handle multiple interpolations on the same line. --- t/front.tc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 't/front.tc') diff --git a/t/front.tc b/t/front.tc index 89e665a..3307c21 100644 --- a/t/front.tc +++ b/t/front.tc @@ -1,16 +1,15 @@ printf("

"); printf("%s", site.name ); -printf("

\n"); - printf("Hello world!"); printf("\n
\nRequest method: "); +printf("\n

Thanks for the "); printf("%s", getenv("REQUEST_METHOD") ); -printf("
\n"); - char *a, *b, *bv; - a = nextparam(512); - printf("%s (%d)
", a, TRUNCATED(a)); - b = nextparam(512); - printf("%s (%d)
", b, TRUNCATED(b)); - bv = split(b); - printf("'%s' contains '%s'
", b, bv); - printf("Next: %s\n", nextparam(512)); - printf("Next: %s\n", nextparam(512)); -printf("\n"); +printf(" request!

\n\n \n \n \n \n "); + char *p, *v; + while(p = nextparam(GET, 512)){ + v = split(p); + printf("\n \n \n \n \n "); + } + printf("\n
KeyValue
"); +printf("%s", p ); +printf(""); +printf("%s", v ); +printf("
"); -- cgit v1.2.3