From a4c7003b70fd3dc68cde5250ed74ee457bcecfe1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 20 Jun 2008 19:22:25 +0200 Subject: [PATCH] =?utf8?q?fix=20a=20stupid=20duplicate=20value=20checking?= =?utf8?q?=20bug=20(patch=20by=20Fr=C3=A9d=C3=A9ric=20Moulins)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- list.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/list.c b/list.c index 67bde39..b20ee71 100644 --- a/list.c +++ b/list.c @@ -315,6 +315,7 @@ int uci_set_element_value(struct uci_context *ctx, struct uci_element **element, struct uci_element *e; struct uci_package *p; struct uci_section *s; + struct uci_option *o; char *section; char *option; char *str; @@ -348,11 +349,12 @@ int uci_set_element_value(struct uci_context *ctx, struct uci_element **element, case UCI_TYPE_OPTION: UCI_ASSERT(ctx, value != NULL); size = sizeof(struct uci_option); - s = uci_to_option(e)->section; + o = uci_to_option(e); + s = o->section; section = s->e.name; - option = e->name; + option = o->e.name; /* matches the currently set value */ - if (!strcmp(value, e->name)) + if (!strcmp(value, o->value)) return 0; break; default: -- 2.41.1