Author: amdmi3 (ports committer)
Date: Fri Jan 13 10:28:24 2017
New Revision: 312061
URL: https://svnweb.freebsd.org/changeset/base/312061

Log:
  MFC r310718:
  
  bzip2 does not exit after showing license as requested with --version
  or --license as most apps would do, instead it waits for data to
  compress on stdin. Because of that, if `bzip2 --version' is called,
  bogus `bzip2: I won't write compressed data to a terminal' error
  message will be displayed, and checking for bzip2 version in scripts
  as in
  
      bzip2 --version 2>&1 | grep -o "Version [^,]*"
  
  will hand as bzip2 would wait for data to compress on stdin. Fix
  this by exiting right after showing version/license text.
  
  I've tried to push this upstream for more than a year, but author
  is unresponsive, so upstream may be considered dead.
  
  Ubuntu applies similar fix, for the note.
  
  PR:           199443
  Approved by:  dim, bapt
  Differential Revision:        D8924

Modified:
  stable/10/contrib/bzip2/bzip2.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bzip2/bzip2.c
==============================================================================
--- stable/10/contrib/bzip2/bzip2.c     Fri Jan 13 09:32:11 2017        
(r312060)
+++ stable/10/contrib/bzip2/bzip2.c     Fri Jan 13 10:28:24 2017        
(r312061)
@@ -1890,7 +1890,9 @@ IntNative main ( IntNative argc, Char *a
                case '8': blockSize100k    = 8; break;
                case '9': blockSize100k    = 9; break;
                case 'V':
-               case 'L': license();            break;
+               case 'L': license();
+                         exit ( 0 );
+                         break;
                case 'v': verbosity++; break;
                case 'h': usage ( progName );
                          exit ( 0 );
@@ -1916,8 +1918,8 @@ IntNative main ( IntNative argc, Char *a
       if (ISFLAG("--keep"))              keepInputFiles   = True;    else
       if (ISFLAG("--small"))             smallMode        = True;    else
       if (ISFLAG("--quiet"))             noisy            = False;   else
-      if (ISFLAG("--version"))           license();                  else
-      if (ISFLAG("--license"))           license();                  else
+      if (ISFLAG("--version"))           { license(); exit ( 0 ); }  else
+      if (ISFLAG("--license"))           { license(); exit ( 0 ); }  else
       if (ISFLAG("--exponential"))       workFactor = 1;             else 
       if (ISFLAG("--repetitive-best"))   redundant(aa->name);        else
       if (ISFLAG("--repetitive-fast"))   redundant(aa->name);        else
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to