]> sjero.net Git - wget/blobdiff - src/ftp.c
Fixed bug #23238: --no-clobber doesn't work with -O flag
[wget] / src / ftp.c
index 5a9ecc6a694969a054c1c33560bbfc913b623f20..e6163880ec0c7996cea37c4d2eddeee0e1f3a938 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1091,7 +1091,9 @@ ftp_loop_internal (struct url *u, struct fileinfo *f, ccon *con)
   if (!con->target)
     con->target = url_file_name (u);
 
-  if (opt.noclobber && file_exists_p (con->target))
+  /* If the output_document was given, then this check was already done and
+     the file doesn't exist. Hence the !opt.output_document */
+  if (opt.noclobber && !opt.output_document && file_exists_p (con->target))
     {
       logprintf (LOG_VERBOSE,
                  _("File `%s' already there; not retrieving.\n"), con->target);