]> pilppa.org Git - uci.git/commitdiff
load the saved history by default to make things easier for the lua binding
authorFelix Fietkau <nbd@openwrt.org>
Tue, 3 Jun 2008 20:23:10 +0000 (22:23 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 3 Jun 2008 20:23:10 +0000 (22:23 +0200)
cli.c
libuci.c

diff --git a/cli.c b/cli.c
index 229352f3bf2124846cbf7d4511fbd6bb409ea5d2..02a34c0d6e40e955aa95233f2e11f2587b2792c3 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -135,11 +135,7 @@ static int package_cmd(int cmd, char *package)
        struct uci_package *p = NULL;
        int ret;
 
-       if (cmd == CMD_CHANGES)
-               ctx->flags |= UCI_FLAG_SAVED_HISTORY;
        ret = uci_load(ctx, package, &p);
-       if (cmd == CMD_CHANGES)
-               ctx->flags &= ~UCI_FLAG_SAVED_HISTORY;
 
        if (ret != UCI_OK) {
                cli_perror();
index 5b5db54718a5bb6dc20fc52ade8404397aa6a9f3..5872ae4220a8fff2810a68aa7e83b9a97a329396 100644 (file)
--- a/libuci.c
+++ b/libuci.c
@@ -56,7 +56,7 @@ struct uci_context *uci_alloc_context(void)
        uci_list_init(&ctx->root);
        uci_list_init(&ctx->history_path);
        uci_list_init(&ctx->backends);
-       ctx->flags = UCI_FLAG_STRICT;
+       ctx->flags = UCI_FLAG_STRICT | UCI_FLAG_SAVED_HISTORY;
 
        ctx->confdir = (char *) uci_confdir;
        ctx->savedir = (char *) uci_savedir;