#include "http.h" /* for save_cookies */
#include <getopt.h>
-#include "getpass.h"
+#include <getpass.h>
+#include <quote.h>
#ifndef PATH_SEPARATOR
# define PATH_SEPARATOR '/'
prompt_for_password (void)
{
if (opt.user)
- printf (_("Password for user \"%s\": "), opt.user);
+ printf (_("Password for user %s: "), quote (opt.user));
else
printf (_("Password: "));
return getpass("");
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)
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();
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)))
{