]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Revert "tc: Remove pointless assignments in batch()"
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 1 Aug 2019 00:16:54 +0000 (17:16 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 2 Aug 2019 16:34:36 +0000 (09:34 -0700)
This reverts commit 6358bbc381c6e38465838370bcbbdeb77ec3565a.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
tc/tc.c

diff --git a/tc/tc.c b/tc/tc.c
index 64e342dd85bffd4cfbe003a1fe95458718ea87ac..1f23971ae4b9a1ed86a48a1498664c3ed102de0a 100644 (file)
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -326,11 +326,11 @@ static int batch(const char *name)
        struct batch_buf *head = NULL, *tail = NULL, *buf_pool = NULL;
        char *largv[100], *largv_next[100];
        char *line, *line_next = NULL;
+       bool bs_enabled_next = false;
        bool bs_enabled = false;
        bool lastline = false;
        int largc, largc_next;
        bool bs_enabled_saved;
-       bool bs_enabled_next;
        int batchsize = 0;
        size_t len = 0;
        int ret = 0;
@@ -359,6 +359,7 @@ static int batch(const char *name)
                goto Exit;
        largc = makeargs(line, largv, 100);
        bs_enabled = batchsize_enabled(largc, largv);
+       bs_enabled_saved = bs_enabled;
        do {
                if (getcmdline(&line_next, &len, stdin) == -1)
                        lastline = true;
@@ -394,6 +395,7 @@ static int batch(const char *name)
                len = 0;
                bs_enabled_saved = bs_enabled;
                bs_enabled = bs_enabled_next;
+               bs_enabled_next = false;
 
                if (largc == 0) {
                        largc = largc_next;