]> sjero.net Git - wget/blobdiff - src/main.c
Fixed bug #23238: --no-clobber doesn't work with -O flag
[wget] / src / main.c
index fbdafd2b1544032912baf8c0fee1b5321b9b6425..fdf368a51fc2e897e9fc2e236a8d5e9744bea2f5 100644 (file)
@@ -903,7 +903,14 @@ will be placed in the single file you specified.\n\n"));
           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)