changeset 145:b1b33f7cf555

Fix GET parsing for inputs without =
author Adam Chlipala <adamc@hcoop.net>
date Tue, 22 Jul 2008 15:22:34 -0400
parents f0d3402184d1
children 80ac94b54e41
files src/c/driver.c
diffstat 1 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/driver.c	Tue Jul 22 15:12:20 2008 -0400
+++ b/src/c/driver.c	Tue Jul 22 15:22:34 2008 -0400
@@ -122,22 +122,17 @@
 
           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;
+            else
               lw_set_input(ctx, name, "");
-            }
-            else {
-              inputs = strchr(value, 0);
-              lw_set_input(ctx, name, "");
-            }
           }
         }