X-Git-Url: http://git.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=list.c;fp=list.c;h=e6ef1c188ebf54461cc3aa6199a6e2934d2fd127;hp=f3a9ed6fa8566a8b30f83bbf61ba371b42ade08c;hb=c9c9d5cb085acc58b6579ace83fb79c085a9db27;hpb=9d8e1fe4857c1c3e8f1a2e2ae59ef9c4790adb39 diff --git a/list.c b/list.c index f3a9ed6..e6ef1c1 100644 --- a/list.c +++ b/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); }