Browse Source

uci: fix excessive reorder delta entry duplication

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Felix Fietkau 11 years ago
parent
commit
c9c9d5cb08
1 changed files with 2 additions and 1 deletions
  1. 2 1
      list.c

+ 2 - 1
list.c

@@ -515,12 +515,13 @@ int uci_rename(struct uci_context *ctx, struct uci_ptr *ptr)
 int uci_reorder_section(struct uci_context *ctx, struct uci_section *s, int pos)
 {
 	struct uci_package *p = s->package;
+	bool internal = ctx && ctx->internal;
 	char order[32];
 
 	UCI_HANDLE_ERR(ctx);
 
 	uci_list_set_pos(&s->package->sections, &s->e.list, pos);
-	if (!ctx->internal && p->has_delta) {
+	if (!internal && p->has_delta) {
 		sprintf(order, "%d", pos);
 		uci_add_delta(ctx, &p->delta, UCI_CMD_REORDER, s->e.name, NULL, order);
 	}