From da42860153178241d05f7aaa0ecac39b5982e689 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 22 Jul 2008 15:22:34 -0400 Subject: Fix GET parsing for inputs without = --- src/c/driver.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/c/driver.c b/src/c/driver.c index af3bca08..90538104 100644 --- a/src/c/driver.c +++ b/src/c/driver.c @@ -122,22 +122,17 @@ static void *worker(void *data) { while (*inputs) { name = inputs; - if (value = strchr(inputs, '=')) { + if (inputs = strchr(inputs, '&')) + *inputs++ = 0; + else + inputs = strchr(name, 0); + + if (value = strchr(name, '=')) { *value++ = 0; - if (inputs = strchr(value, '&')) - *inputs++ = 0; - else - inputs = strchr(value, 0); lw_set_input(ctx, name, value); } - else if (inputs = strchr(value, '&')) { - *inputs++ = 0; - lw_set_input(ctx, name, ""); - } - else { - inputs = strchr(value, 0); + else lw_set_input(ctx, name, ""); - } } } -- cgit v1.2.3