From b42ee8f21842fab41a4cdf27960000bb1b3f42a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Krzysztof=20Ku=C5=BAnik?= Date: Thu, 28 Feb 2013 13:44:00 +0000 Subject: [PATCH] uci: Fix uci_delete() when ptr->value is empty string MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit After fix for deleting list elements by index this function was broken and didn't allow to invoke from command line: uci set some.fancy.list='' i.e. list wasn't cleared Signed-off-by: Krzysztof Kuźnik --- list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/list.c b/list.c index f47b5a8..f3a9ed6 100644 --- a/list.c +++ b/list.c @@ -559,7 +559,7 @@ int uci_delete(struct uci_context *ctx, struct uci_ptr *ptr) UCI_ASSERT(ctx, ptr->s); - if (ptr->value && ptr->o && ptr->o->type == UCI_TYPE_LIST) { + if (ptr->value && *ptr->value && ptr->o && ptr->o->type == UCI_TYPE_LIST) { if (!sscanf(ptr->value, "%d", &index)) return 1; -- 2.11.0