aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2012-07-22 01:55:45 +0200
committerKamil Dudka <kdudka@redhat.com>2012-07-22 02:06:22 +0200
commit487406c3c0d86c5ef3fd323df35db71467b02a92 (patch)
tree959e9495f27211dbadb587629bf93d4e49e7ed1e
parent2c7cfd2926edda7f2a3ea3aeb8b91a6923b765fd (diff)
tool_operate: fix misplaced initialization of orig_noprogress
... and orig_isatty which caused --silent to be entirely ignored in case the standard output was redirected to a file!
-rw-r--r--src/tool_operate.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 7c0b8b5fe..f4abc3b75 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -140,8 +140,8 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
int res = 0;
int i;
- bool orig_noprogress = config->noprogress;
- bool orig_isatty = config->isatty;
+ bool orig_noprogress;
+ bool orig_isatty;
errorbuffer[0] = '\0';
/* default headers output stream is stdout */
@@ -396,6 +396,10 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
}
}
+ /* save the values of noprogress and isatty to restore them later on */
+ orig_noprogress = config->noprogress;
+ orig_isatty = config->isatty;
+
/*
** Nested loops start here.
*/