wget: reduce bloat

Signed-off-by: Pere Orga <gotrunks@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Pere Orga 2011-02-16 20:09:36 +01:00 committed by Denys Vlasenko
parent 5827167338
commit 5369563bf9

View File

@ -556,7 +556,7 @@ static void NOINLINE retrieve_file_data(FILE *dfp)
progress_meter(PROGRESS_END); progress_meter(PROGRESS_END);
} }
static int download_one_url(const char *url) static void download_one_url(const char *url)
{ {
bool use_proxy; /* Use proxies if env vars are set */ bool use_proxy; /* Use proxies if env vars are set */
int redir_limit; int redir_limit;
@ -853,8 +853,6 @@ However, in real world it was observed that some web servers
free(server.allocated); free(server.allocated);
free(target.allocated); free(target.allocated);
free(fname_out_alloc); free(fname_out_alloc);
return EXIT_SUCCESS;
} }
int wget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int wget_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@ -885,7 +883,6 @@ int wget_main(int argc UNUSED_PARAM, char **argv)
; ;
#endif #endif
int exitcode;
#if ENABLE_FEATURE_WGET_LONG_OPTIONS #if ENABLE_FEATURE_WGET_LONG_OPTIONS
llist_t *headers_llist = NULL; llist_t *headers_llist = NULL;
#endif #endif
@ -937,12 +934,11 @@ int wget_main(int argc UNUSED_PARAM, char **argv)
G.o_flags = O_WRONLY | O_CREAT | O_TRUNC; G.o_flags = O_WRONLY | O_CREAT | O_TRUNC;
} }
exitcode = 0;
while (*argv) while (*argv)
exitcode |= download_one_url(*argv++); download_one_url(*argv++);
if (G.output_fd >= 0) if (G.output_fd >= 0)
xclose(G.output_fd); xclose(G.output_fd);
return exitcode; return EXIT_SUCCESS;
} }