comparison src/c/driver.c @ 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 2be573fec9a6
comparison
equal deleted inserted replaced
144:f0d3402184d1 145:b1b33f7cf555
120 char *name, *value; 120 char *name, *value;
121 *inputs++ = 0; 121 *inputs++ = 0;
122 122
123 while (*inputs) { 123 while (*inputs) {
124 name = inputs; 124 name = inputs;
125 if (value = strchr(inputs, '=')) { 125 if (inputs = strchr(inputs, '&'))
126 *inputs++ = 0;
127 else
128 inputs = strchr(name, 0);
129
130 if (value = strchr(name, '=')) {
126 *value++ = 0; 131 *value++ = 0;
127 if (inputs = strchr(value, '&'))
128 *inputs++ = 0;
129 else
130 inputs = strchr(value, 0);
131 lw_set_input(ctx, name, value); 132 lw_set_input(ctx, name, value);
132 } 133 }
133 else if (inputs = strchr(value, '&')) { 134 else
134 *inputs++ = 0;
135 lw_set_input(ctx, name, ""); 135 lw_set_input(ctx, name, "");
136 }
137 else {
138 inputs = strchr(value, 0);
139 lw_set_input(ctx, name, "");
140 }
141 } 136 }
142 } 137 }
143 138
144 printf("Serving URI %s....\n", path); 139 printf("Serving URI %s....\n", path);
145 140