• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 65179284ceddc43e6388bf4ed8c2d85cf16e1b2f Mon Sep 17 00:00:00 2001
2From: Rikard Gynnerstedt <rikard.gynnerstedt@gmail.com>
3Date: Thu, 24 Oct 2019 12:48:57 +0200
4Subject: [PATCH] license and version print should output to stdout and exit
5 with code 0
6Reference: https://gitlab.com/bzip2/bzip2/-/commit/65179284ceddc43e6388bf4ed8c2d85cf16e1b2f
7Conflict: NA
8---
9 bzip2.c | 10 ++++++----
10 1 file changed, 6 insertions(+), 4 deletions(-)
11
12diff --git a/bzip2.c b/bzip2.c
13index ed1a33f..6da2905 100644
14--- a/bzip2.c
15+++ b/bzip2.c
16@@ -1600,7 +1600,7 @@ void testf ( Char *name )
17 static
18 void license ( void )
19 {
20-   fprintf ( stderr,
21+   fprintf ( stdout,
22
23     "bzip2, a block-sorting file compressor.  "
24     "Version %s.\n"
25@@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *argv[] )
26                case '8': blockSize100k    = 8; break;
27                case '9': blockSize100k    = 9; break;
28                case 'V':
29-               case 'L': license();            break;
30+               case 'L': license();
31+                         exit ( 0 );
32+                         break;
33                case 'v': verbosity++; break;
34                case 'h': usage ( progName );
35                          exit ( 0 );
36@@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *argv[] )
37       if (ISFLAG("--keep"))              keepInputFiles   = True;    else
38       if (ISFLAG("--small"))             smallMode        = True;    else
39       if (ISFLAG("--quiet"))             noisy            = False;   else
40-      if (ISFLAG("--version"))           license();                  else
41-      if (ISFLAG("--license"))           license();                  else
42+      if (ISFLAG("--version"))           { license(); exit ( 0 ); }  else
43+      if (ISFLAG("--license"))           { license(); exit ( 0 ); }  else
44       if (ISFLAG("--exponential"))       workFactor = 1;             else
45       if (ISFLAG("--repetitive-best"))   redundant(aa->name);        else
46       if (ISFLAG("--repetitive-fast"))   redundant(aa->name);        else
47--
48GitLab
49