]> sjero.net Git - wget/commitdiff
Print some diagnostic messages to stderr not to stdout.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 23 Feb 2012 10:56:44 +0000 (11:56 +0100)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 23 Feb 2012 10:56:44 +0000 (11:56 +0100)
NEWS
src/ChangeLog
src/main.c

diff --git a/NEWS b/NEWS
index 61a4983ad13fab347e3701ac748a5c2768724b50..3a6aca0d50ba3803b11b4bfc3e21c5cd3eb7de73 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ Please send GNU Wget bug reports to <bug-wget@gnu.org>.
 ** Fix a memory leak problem in the GNU TLS backend.
 
 ** Autoreconf works again for distributed tarballs.
+
+** Print some diagnostic messages to stderr not to stdout.
 \f
 * Changes in Wget 1.13.4
 
index 13ab1ae701e09c4e06d96b81ea25b6fe70eb5353..e5def2a83508fac568b33b3a197c688f073ac00a 100644 (file)
@@ -1,5 +1,7 @@
 2012-02-23  Giuseppe Scrivano  <giuseppe@southpole.se>
 
+       * main.c (main): Write diagnostic messages to `stderr' not to `stdout'.
+
        * main.c (main): Fail gracefully if `malloc' fails.
 
        * gnutls.c (wgnutls_read): Remove unused variables `timer' and `flags'.
index 9eefc98fcfdc5392f920799067c499113f25f0af..352715a0079187686bc7cf45649f05627bb459ee 100644 (file)
@@ -1034,7 +1034,7 @@ main (int argc, char **argv)
             }
           if (!userrc_ret)
             {
-              printf ("Exiting due to error in %s\n", optarg);
+              fprintf (stderr, "Exiting due to error in %s\n", optarg);
               exit (2);
             }
           else
@@ -1062,9 +1062,10 @@ main (int argc, char **argv)
         {
           if (ret == '?')
             {
-              print_usage (0);
-              printf ("\n");
-              printf (_("Try `%s --help' for more options.\n"), exec_name);
+              print_usage (1);
+              fprintf (stderr, "\n");
+              fprintf (stderr, _("Try `%s --help' for more options.\n"),
+                      exec_name);
               exit (2);
             }
           /* Find the short option character in the mapping.  */
@@ -1307,7 +1308,7 @@ for details.\n\n"));
       /* No URL specified.  */
       fprintf (stderr, _("%s: missing URL\n"), exec_name);
       print_usage (1);
-      printf ("\n");
+      fprintf (stderr, "\n");
       /* #### Something nicer should be printed here -- similar to the
          pre-1.5 `--help' page.  */
       fprintf (stderr, _("Try `%s --help' for more options.\n"), exec_name);