summaryrefslogtreecommitdiff
path: root/render/form.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2006-02-04 14:40:01 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2006-02-04 14:40:01 +0000
commit4c90aad6599460b2c5059aedbdf609cb59f10569 (patch)
treeed6ea9d9cf14bd51be108992fa06b8a329a5c881 /render/form.c
parent2ef092f54652399ac3c016f8d7e435fd8e199487 (diff)
downloadnetsurf-4c90aad6599460b2c5059aedbdf609cb59f10569.tar.gz
netsurf-4c90aad6599460b2c5059aedbdf609cb59f10569.tar.bz2
[project @ 2006-02-04 14:40:01 by jmb]
Fix handling of controls with no value - should fix 1424022. svn path=/import/netsurf/; revision=2056
Diffstat (limited to 'render/form.c')
-rw-r--r--render/form.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/render/form.c b/render/form.c
index 67bf52a32..8a9521541 100644
--- a/render/form.c
+++ b/render/form.c
@@ -218,15 +218,12 @@ bool form_successful_controls(struct form *form,
switch (control->type) {
case GADGET_HIDDEN:
- /* ignore hidden controls with no value */
- /* this fixes ebay silliness */
- if (!control->value)
- continue;
-
- /* fall through */
case GADGET_TEXTBOX:
case GADGET_PASSWORD:
- value = strdup(control->value);
+ if (control->value)
+ value = strdup(control->value);
+ else
+ value = strdup("");
if (!value) {
LOG(("failed to duplicate value"
"'%s' for control %s",
@@ -369,7 +366,10 @@ bool form_successful_controls(struct form *form,
/* only the activated submit button
* is successful */
continue;
- value = strdup(control->value);
+ if (control->value)
+ value = strdup(control->value);
+ else
+ value = strdup("");
if (!value) {
LOG(("failed to duplicate value"
"'%s' for control %s",