X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fmain.c;h=e1265708b88cbdf62e9d05714942a4951e09ac62;hp=b0fceae062b80dbe486e1500500506b29d8f5b15;hb=766df9d4e9392045a4e5c730ed81e599b509557a;hpb=3c1725e7a1805c8c99f021a04f03bf5a783ffecf diff --git a/src/main.c b/src/main.c index b0fceae0..e1265708 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,6 @@ /* Command line parsing. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Wget. @@ -80,6 +80,9 @@ static void redirect_output_signal (int); #endif const char *exec_name; + +/* Number of successfully downloaded URLs */ +int numurls = 0; #ifndef TESTING /* Initialize I18N/L10N. That amounts to invoking setlocale, and @@ -733,13 +736,7 @@ format_and_print_line (const char *prefix, const char *line, token on the next line. */ if (remaining_chars <= strlen (token)) { - int j; - printf ("\n"); - j = 0; - for (j = 0; j < leading_spaces; j++) - { - printf (" "); - } + printf ("\n%*c", leading_spaces, ' '); remaining_chars = line_length - leading_spaces; } printf ("%s ", token); @@ -1127,7 +1124,7 @@ for details.\n\n")); { #ifdef WINDOWS FILE *result; - result = freopen (NULL, "wb", stdout); + result = freopen ("CONOUT$", "wb", stdout); if (result == NULL) { logputs (LOG_NOTQUIET, _("\ @@ -1237,7 +1234,7 @@ WARNING: Can't reopen standard output in binary mode;\n\ logprintf (LOG_NOTQUIET, _("FINISHED --%s--\nDownloaded: %d files, %s in %s (%s)\n"), datetime_str (time (NULL)), - opt.numurls, + numurls, human_readable (total_downloaded_bytes), secs_to_human_time (total_download_time), retr_rate (total_downloaded_bytes, total_download_time));