]> sjero.net Git - wget/blobdiff - src/main.c
Fixed bug #23238: --no-clobber doesn't work with -O flag
[wget] / src / main.c
index 421a5501b6e34e4795a9a62e779289e42aff1a2f..fdf368a51fc2e897e9fc2e236a8d5e9744bea2f5 100644 (file)
@@ -905,6 +905,12 @@ WARNING: timestamping does nothing in combination with -O. See the manual\n\
 for details.\n\n"));
           opt.timestamping = false;
         }
+      if (opt.noclobber && file_exists_p(opt.output_document)) 
+           { 
+              /* Check if output file exists; if it does, exit. */
+              logprintf (LOG_VERBOSE, _("File `%s' already there; not retrieving.\n"), opt.output_document);
+              exit(1);
+           }  
     }
 
   if (!nurl && !opt.input_filename)