]> sjero.net Git - wget/blobdiff - src/main.c
Fixed bug #23238: --no-clobber doesn't work with -O flag
[wget] / src / main.c
index 1ad0a48cc8c273ae559e426132034b13f9109ef0..fdf368a51fc2e897e9fc2e236a8d5e9744bea2f5 100644 (file)
@@ -900,11 +900,17 @@ will be placed in the single file you specified.\n\n"));
         }
       if (opt.timestamping)
         {
-          fputs (_("\
-Cannot specify -N if -O is given. See the manual for details.\n\n"), stdout);
-          print_usage ();
-          exit (1);
+          logprintf (LOG_NOTQUIET, "%s", _("\
+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)