From 4c90aad6599460b2c5059aedbdf609cb59f10569 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 4 Feb 2006 14:40:01 +0000 Subject: [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 --- render/form.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'render') 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", -- cgit v1.2.3