X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fmain.c;h=d68cdbd6b937db48b44ca3d20b926c88e27cee08;hb=f7235a59b707cabf831127100916de63b2ef1bc7;hp=e239b6d009ff0aa71456ed150aacc7a69c585e0b;hpb=051528cb8535c53248613bdf82976b345af7532d;p=wget diff --git a/src/main.c b/src/main.c index e239b6d0..d68cdbd6 100644 --- a/src/main.c +++ b/src/main.c @@ -920,6 +920,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 (opt.ask_passwd && opt.passwd) @@ -941,6 +947,14 @@ for details.\n\n")); exit (1); } + if (opt.ask_passwd) + { + opt.passwd = prompt_for_password (); + + if (opt.passwd == NULL || opt.passwd[0] == '\0') + exit (1); + } + #ifdef MSDOS if (opt.wdebug) dbug_init(); @@ -1024,9 +1038,6 @@ for details.\n\n")); char *filename = NULL, *redirected_URL = NULL; int dt; - if (opt.ask_passwd) - opt.passwd = prompt_for_password (); - if ((opt.recursive || opt.page_requisites) && (url_scheme (*t) != SCHEME_FTP || url_uses_proxy (*t))) {