Skip to content

Commit

Permalink
Write version and license information to stdout instead of stderr.
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Jun 24, 2019
1 parent ce021e0 commit c3de75b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pigz.c
Expand Up @@ -188,7 +188,7 @@
Fix sign error in compression reduction percentage
*/

#define VERSION "pigz 2.4.1x\n"
#define VERSION "pigz 2.4.1x"

/* To-do:
- make source portable for Windows, VMS, etc. (see gzip source code)
Expand Down Expand Up @@ -4408,11 +4408,10 @@ local int option(char *arg) {
#endif
case 'K': g.form = 2; g.sufx = ".zip"; break;
case 'L':
fputs(VERSION, stderr);
fputs("Copyright (C) 2007-2017 Mark Adler\n", stderr);
fputs("Subject to the terms of the zlib license.\n",
stderr);
fputs("No warranty is provided or implied.\n", stderr);
puts(VERSION);
puts("Copyright (C) 2007-2017 Mark Adler");
puts("Subject to the terms of the zlib license.");
puts("No warranty is provided or implied.");
exit(0);
case 'M': g.headis |= 0xa; break;
case 'N': g.headis = 0xf; break;
Expand All @@ -4423,9 +4422,9 @@ local int option(char *arg) {
case 'S': get = 3; break;
// -T defined below as an alternative for -m
case 'V':
fputs(VERSION, stderr);
puts(VERSION);
if (g.verbosity > 1)
fprintf(stderr, "zlib %s\n", zlibVersion());
printf("zlib %s\n", zlibVersion());
exit(0);
case 'Y': g.sync = 1; break;
case 'Z':
Expand Down

0 comments on commit c3de75b

Please sign in to comment.