diff options
author | Martin Lewis <martin.lewis.x84@gmail.com> | 2019-01-10 13:59:30 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-17 13:46:14 +0100 |
commit | 94e748d0276a089ca9093767d15b5d050e0218b1 (patch) | |
tree | 623cddcb88d63e8d30d8c206feb4043d096b0b3a | |
parent | edb74f40191458f3ae581e3ad385832906f7a39e (diff) | |
download | busybox-w32-94e748d0276a089ca9093767d15b5d050e0218b1.tar.gz busybox-w32-94e748d0276a089ca9093767d15b5d050e0218b1.tar.bz2 busybox-w32-94e748d0276a089ca9093767d15b5d050e0218b1.zip |
wget: don't notify on download begin and end if quiet
When printing notification on download start and end,
mistakenly, it didn't respect the quiet option
function old new delta
retrieve_file_data 561 579 +18
wget_main 2432 2437 +5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/0 up/down: 23/0) Total: 23 bytes
Signed-off-by: Martin Lewis <martin.lewis.x84@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/wget.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/networking/wget.c b/networking/wget.c index 3a02de6ca..735746e38 100644 --- a/networking/wget.c +++ b/networking/wget.c | |||
@@ -876,10 +876,12 @@ static void NOINLINE retrieve_file_data(FILE *dfp) | |||
876 | polldata.fd = fileno(dfp); | 876 | polldata.fd = fileno(dfp); |
877 | polldata.events = POLLIN | POLLPRI; | 877 | polldata.events = POLLIN | POLLPRI; |
878 | #endif | 878 | #endif |
879 | if (G.output_fd == 1) | 879 | if (!(option_mask32 & WGET_OPT_QUIET)) { |
880 | fprintf(stderr, "writing to stdout\n"); | 880 | if (G.output_fd == 1) |
881 | else | 881 | fprintf(stderr, "writing to stdout\n"); |
882 | fprintf(stderr, "saving to '%s'\n", G.fname_out); | 882 | else |
883 | fprintf(stderr, "saving to '%s'\n", G.fname_out); | ||
884 | } | ||
883 | progress_meter(PROGRESS_START); | 885 | progress_meter(PROGRESS_START); |
884 | 886 | ||
885 | if (G.chunked) | 887 | if (G.chunked) |
@@ -1025,10 +1027,12 @@ static void NOINLINE retrieve_file_data(FILE *dfp) | |||
1025 | G.chunked = 0; /* makes it show 100% even for chunked download */ | 1027 | G.chunked = 0; /* makes it show 100% even for chunked download */ |
1026 | G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */ | 1028 | G.got_clen = 1; /* makes it show 100% even for download of (formerly) unknown size */ |
1027 | progress_meter(PROGRESS_END); | 1029 | progress_meter(PROGRESS_END); |
1028 | if (G.output_fd == 1) | 1030 | if (!(option_mask32 & WGET_OPT_QUIET)) { |
1029 | fprintf(stderr, "written to stdout\n"); | 1031 | if (G.output_fd == 1) |
1030 | else | 1032 | fprintf(stderr, "written to stdout\n"); |
1031 | fprintf(stderr, "'%s' saved\n", G.fname_out); | 1033 | else |
1034 | fprintf(stderr, "'%s' saved\n", G.fname_out); | ||
1035 | } | ||
1032 | } | 1036 | } |
1033 | 1037 | ||
1034 | static void download_one_url(const char *url) | 1038 | static void download_one_url(const char *url) |
@@ -1389,7 +1393,8 @@ However, in real world it was observed that some web servers | |||
1389 | G.output_fd = -1; | 1393 | G.output_fd = -1; |
1390 | } | 1394 | } |
1391 | } else { | 1395 | } else { |
1392 | fprintf(stderr, "remote file exists\n"); | 1396 | if (!(option_mask32 & WGET_OPT_QUIET)) |
1397 | fprintf(stderr, "remote file exists\n"); | ||
1393 | } | 1398 | } |
1394 | 1399 | ||
1395 | if (dfp != sfp) { | 1400 | if (dfp != sfp) { |