summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--list.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/list.c b/list.c
index 5148dfd..ba099b6 100644
--- a/list.c
+++ b/list.c
@@ -652,6 +652,8 @@ int uci_add_list(struct uci_context *ctx, struct uci_ptr *ptr)
ptr->o = uci_alloc_list(ptr->s, ptr->option);
if (prev) {
uci_add_element_list(ctx, ptr, true);
+ if (ptr->option == prev->e.name)
+ ptr->option = ptr->o->e.name;
uci_free_option(prev);
ptr->value = value2;
}