consistency
authorFelix Fietkau <nbd@openwrt.org>
Tue, 12 Feb 2008 11:24:36 +0000 (12:24 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 12 Feb 2008 11:24:36 +0000 (12:24 +0100)
list.c

diff --git a/list.c b/list.c
index fb4d478..376d38b 100644 (file)
--- a/list.c
+++ b/list.c
@@ -401,6 +401,7 @@ int uci_rename(struct uci_context *ctx, struct uci_package *p, char *section, ch
 
 int uci_add_section(struct uci_context *ctx, struct uci_package *p, char *type, struct uci_section **res)
 {
+       bool internal = ctx->internal;
        struct uci_section *s;
 
        UCI_HANDLE_ERR(ctx);
@@ -408,7 +409,8 @@ int uci_add_section(struct uci_context *ctx, struct uci_package *p, char *type,
        s = uci_alloc_section(p, type, NULL);
        uci_fixup_section(ctx, s);
        *res = s;
-       uci_add_history(ctx, &p->history, UCI_CMD_ADD, s->e.name, NULL, type);
+       if (!internal && p->has_history)
+               uci_add_history(ctx, &p->history, UCI_CMD_ADD, s->e.name, NULL, type);
 
        return 0;
 }