fix uci batch nesting check (patch by lars)
authorFelix Fietkau <nbd@openwrt.org>
Thu, 4 Sep 2008 23:20:09 +0000 (01:20 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 4 Sep 2008 23:20:09 +0000 (01:20 +0200)
cli.c

diff --git a/cli.c b/cli.c
index 305d9fe..9a4f819 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -440,6 +440,7 @@ static int uci_batch(void)
 {
        int ret = 0;
 
+       flags |= CLI_FLAG_BATCH;
        while (!feof(input)) {
                struct uci_element *e, *tmp;
 
@@ -454,6 +455,8 @@ static int uci_batch(void)
                        uci_unload(ctx, uci_to_package(e));
                }
        }
+       flags &= ~CLI_FLAG_BATCH;
+
        return 0;
 }