]> sjero.net Git - wget/blobdiff - src/main.c
Password prompt only once, and before backgrounding.
[wget] / src / main.c
index 159973a0021a2e36e80d5c389f8c40fa38f3b91e..d68cdbd6b937db48b44ca3d20b926c88e27cee08 100644 (file)
@@ -947,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();
@@ -1030,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)))
         {