1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-06-13 18:21:03 +02:00

gpg: Send gpgcompose --help output to stdout, not stderr.

* g10/gpgcompose.c (show_help): Send gpgcompose --help output to
stdout, not stderr.

Reported-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
Neal H. Walfield 2017-06-11 14:10:46 +02:00
parent cb0484e076
commit 7aeac20f12

View File

@ -281,18 +281,18 @@ show_help (struct option options[])
{ {
const char *o = option[0] ? option : "ARG"; const char *o = option[0] ? option : "ARG";
l = strlen (o); l = strlen (o);
fprintf (stderr, "%s", o); fprintf (stdout, "%s", o);
} }
if (! help) if (! help)
{ {
fputc ('\n', stderr); fputc ('\n', stdout);
continue; continue;
} }
if (option) if (option)
for (j = l; j < max_length + 2; j ++) for (j = l; j < max_length + 2; j ++)
fputc (' ', stderr); fputc (' ', stdout);
#define BOLD_START "\033[1m" #define BOLD_START "\033[1m"
#define NORMAL_RESTORE "\033[0m" #define NORMAL_RESTORE "\033[0m"
@ -314,7 +314,7 @@ show_help (struct option options[])
if (! option) if (! option)
{ {
fprintf (stderr, "\n%s\n", formatted); printf ("\n%s\n", formatted);
break; break;
} }
@ -330,10 +330,10 @@ show_help (struct option options[])
if (p != formatted) if (p != formatted)
for (j = 0; j < max_length + 2; j ++) for (j = 0; j < max_length + 2; j ++)
fputc (' ', stderr); fputc (' ', stdout);
fwrite (p, l, 1, stderr); fwrite (p, l, 1, stdout);
fputc ('\n', stderr); fputc ('\n', stdout);
} }
xfree (formatted); xfree (formatted);