From eccb40cac9aa5a446a2b6c1eb61710930223106b Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Sat, 5 Jul 2014 11:54:46 +0530 Subject: [PATCH 2/3] Fix indentation and remove excess variable --- src/ChangeLog | 5 +++++ src/http.c | 21 ++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 7962213..5306cb2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-07-05 Darshit Shah + + * http.c (gethttp): Fix indentation of conditional block + (gethttp): Remove unneeded variable + 2014-07-03 Darshit Shah * wget.h (uerr_t): Remove unused error codes diff --git a/src/http.c b/src/http.c index 4fac3ba..e3c105f 100644 --- a/src/http.c +++ b/src/http.c @@ -2902,19 +2902,18 @@ read_header: } else if (ALLOW_CLOBBER || count > 0) { - if (opt.unlink && file_exists_p (hs->local_file)) - { - int res = unlink (hs->local_file); - if (res < 0) + if (opt.unlink && file_exists_p (hs->local_file)) { - logprintf (LOG_NOTQUIET, "%s: %s\n", hs->local_file, - strerror (errno)); - CLOSE_INVALIDATE (sock); - xfree (head); - xfree_null (type); - return UNLINKERR; + if (unlink (hs->local_file) < 0) + { + logprintf (LOG_NOTQUIET, "%s: %s\n", hs->local_file, + strerror (errno)); + CLOSE_INVALIDATE (sock); + xfree (head); + xfree_null (type); + return UNLINKERR; + } } - } #ifdef __VMS int open_id; -- 2.0.1