From fae9735bb9272e2334b76538df446bb6b2b0de82 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Wed, 20 Mar 2002 11:28:08 +0000 Subject: [PATCH] * textconf.c (version): Write to stdout. * main.c (print_mc_usage): Add "stream" parameter to specify file stream. (process_args): Use print_mc_usage() with stdout as stream. (handle_args): Use print_mc_usage() with stderr as stream. (print_color_usage): Write to stdout. --- src/ChangeLog | 9 +++++++++ src/main.c | 12 ++++++------ src/textconf.c | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f180c5b1d..e9e767194 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2002-03-20 Andrew V. Samoilov + + * textconf.c (version): Write to stdout. + * main.c (print_mc_usage): Add "stream" parameter to specify + file stream. + (process_args): Use print_mc_usage() with stdout as stream. + (handle_args): Use print_mc_usage() with stderr as stream. + (print_color_usage): Write to stdout. + 2002-03-18 Pavel Roskin * eregex.h: Update from glibc-2.2.5. diff --git a/src/main.c b/src/main.c index a328c042f..e930dbb40 100644 --- a/src/main.c +++ b/src/main.c @@ -2209,7 +2209,7 @@ init_sigchld (void) #endif /* _OS_NT, UNIX */ static void -print_mc_usage (void) +print_mc_usage (FILE *stream) { const char * const * ptr; const char * const usage [] = { @@ -2265,7 +2265,7 @@ print_mc_usage (void) version (0); for (ptr = usage; *ptr; ptr++) - fputs (_(*ptr), stderr); + fputs (_(*ptr), stream); } static void @@ -2285,7 +2285,7 @@ print_color_usage (void) "Colors:\n" " black, gray, red, brightred, green, brightgreen, brown,\n" " yellow, blue, brightblue, magenta, brightmagenta, cyan,\n" - " brightcyan, lightgray and white\n\n"), stderr); + " brightcyan, lightgray and white\n\n"), stdout); } static void @@ -2334,7 +2334,7 @@ process_args (int c, const char *option_arg) #endif case 'm': - fprintf (stderr, _("Option -m is obsolete. Please look at Display Bits... in the Option's menu\n")); + fputs (_("Option -m is obsolete. Please look at Display Bits... in the Option's menu\n"), stderr); finish_program = 1; break; @@ -2367,7 +2367,7 @@ process_args (int c, const char *option_arg) break; case 'h': - print_mc_usage (); + print_mc_usage (stdout); finish_program = 1; } } @@ -2462,7 +2462,7 @@ handle_args (int argc, char *argv []) } if (c < -1){ - print_mc_usage (); + print_mc_usage (stderr); fprintf(stderr, "%s: %s\n", poptBadOption (ctx, POPT_BADOPTION_NOALIAS), poptStrerror (c)); diff --git a/src/textconf.c b/src/textconf.c index cb64f93e4..8be24f2f0 100644 --- a/src/textconf.c +++ b/src/textconf.c @@ -96,10 +96,10 @@ version (int verbose) { int i; - fprintf (stderr, _("GNU Midnight Commander %s\n"), VERSION); + fprintf (stdout, _("GNU Midnight Commander %s\n"), VERSION); if (!verbose) return; for (i = 0; features [i]; i++) - fputs (_(features [i]), stderr); + fputs (_(features [i]), stdout); }