bzip2.c revision 199767f8919635c4928607450d9e0abb932109ce
/*-----------------------------------------------------------*/
/*--- A block-sorting, lossless compressor bzip2.c ---*/
/*-----------------------------------------------------------*/
/* ------------------------------------------------------------------
lossless, block-sorting data compression.
Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
Please read the WARNING, DISCLAIMER and PATENTS sections in the
README file.
This program is released under the terms of the license contained
in the file LICENSE.
------------------------------------------------------------------ */
/* Place a 1 beside your platform, and 0 elsewhere.
Generic 32-bit Unix.
Also works on 64-bit Unix boxes.
This is the default.
*/
#define BZ_UNIX 1
/*--
Win32, as seen by Jacob Navia's excellent
port of (Chris Fraser & David Hanson)'s excellent
lcc compiler. Or with MS Visual C.
This is selected automatically if compiled by a compiler which
defines _WIN32, not including the Cygwin GCC.
--*/
#define BZ_LCCWIN32 0
#if defined(_WIN32) && !defined(__CYGWIN__)
#define BZ_LCCWIN32 1
#define BZ_UNIX 0
#endif
/*---------------------------------------------*/
/*--
Some stuff for all platforms.
--*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <math.h>
#include <errno.h>
#include <ctype.h>
#include "bzlib.h"
#define ERROR_IF_NOT_ZERO(i) { if ((i) != 0) ioError(); }
/*---------------------------------------------*/
/*--
Platform-specific stuff.
--*/
#if BZ_UNIX
# include <fcntl.h>
# include <utime.h>
# include <unistd.h>
# define PATH_SEP '/'
# define MY_S_ISREG S_ISREG
# define MY_S_ISDIR S_ISDIR
# ifdef __GNUC__
# else
# define NORETURN /**/
# endif
# ifdef __DJGPP__
# include <io.h>
# include <fcntl.h>
# define SET_BINARY_MODE(fd) \
do { \
O_BINARY ); \
ERROR_IF_MINUS_ONE ( retVal ); \
} while ( 0 )
# endif
# ifdef __CYGWIN__
# include <io.h>
# include <fcntl.h>
# define SET_BINARY_MODE(fd) \
do { \
O_BINARY ); \
ERROR_IF_MINUS_ONE ( retVal ); \
} while ( 0 )
# endif
#endif /* BZ_UNIX */
#if BZ_LCCWIN32
# include <io.h>
# include <fcntl.h>
# define NORETURN /**/
# define PATH_SEP '\\'
# define MY_S_ISREG(x) ((x) & _S_IFREG)
# define MY_S_ISDIR(x) ((x) & _S_IFDIR)
# define SET_BINARY_MODE(fd) \
do { \
O_BINARY ); \
ERROR_IF_MINUS_ONE ( retVal ); \
} while ( 0 )
#endif /* BZ_LCCWIN32 */
/*---------------------------------------------*/
/*--
Some more stuff for all platforms :-)
--*/
typedef char Char;
typedef unsigned char Bool;
typedef unsigned char UChar;
typedef int Int32;
typedef unsigned int UInt32;
typedef short Int16;
typedef unsigned short UInt16;
/*--
IntNative is your platform's `native' int size.
Only here to avoid probs with 64-bit platforms.
--*/
typedef int IntNative;
/*---------------------------------------------------*/
/*--- Misc (file handling) data decls ---*/
/*---------------------------------------------------*/
/*-- source modes; F==file, I==stdin, O==stdout --*/
#define SM_I2O 1
#define SM_F2O 2
#define SM_F2F 3
/*-- operation modes --*/
#define OM_Z 1
#define OM_UNZ 2
#define OM_TEST 3
#define FILE_NAME_LEN 1034
static void outOfMemory ( void ) NORETURN;
static void configError ( void ) NORETURN;
static void compressedStreamEOF ( void ) NORETURN;
/*---------------------------------------------------*/
/*--- An implementation of 64-bit ints. Sigh. ---*/
/*--- Roll on widespread deployment of ANSI C9X ! ---*/
/*---------------------------------------------------*/
typedef
struct { UChar b[8]; }
static
{
}
static
double uInt64_to_double ( UInt64* n )
{
Int32 i;
double base = 1.0;
double sum = 0.0;
for (i = 0; i < 8; i++) {
base *= 256.0;
}
return sum;
}
static
{
Int32 i;
for (i = 0; i < 8; i++)
if (n->b[i] != 0) return 0;
return 1;
}
/* Divide *n by 10, and return the remainder. */
static
{
Int32 i;
rem = 0;
for (i = 7; i >= 0; i--) {
n->b[i] = tmp / 10;
}
return rem;
}
/* ... and the Whole Entire Point of all this UInt64 stuff is
so that we can supply the following function.
*/
static
{
Int32 i, q;
do {
q = uInt64_qrm10 ( &n_copy );
nBuf++;
} while (!uInt64_isZero(&n_copy));
for (i = 0; i < nBuf; i++)
}
/*---------------------------------------------------*/
/*--- Processing of complete files and streams ---*/
/*---------------------------------------------------*/
/*---------------------------------------------*/
static
{
ungetc ( c, f );
return False;
}
/*---------------------------------------------*/
static
{
while (True) {
}
if (fd < 0) goto errhandler_io;
}
if (verbosity >= 1) {
if (nbytes_in_lo32 == 0 && nbytes_in_hi32 == 0) {
} else {
double nbytes_in_d, nbytes_out_d;
"%5.2f%% saved, %s in, %s out.\n",
);
}
}
return;
switch (bzerr) {
case BZ_CONFIG_ERROR:
configError(); break;
case BZ_MEM_ERROR:
outOfMemory (); break;
case BZ_IO_ERROR:
ioError(); break;
default:
panic ( "compress:unexpected error" );
}
panic ( "compress:end" );
/*notreached*/
}
/*---------------------------------------------*/
static
{
void* unusedTmpV;
nUnused = 0;
streamNo = 0;
while (True) {
bzf = BZ2_bzReadOpen (
);
streamNo++;
}
}
if (fd < 0) goto errhandler_io;
}
if (ret != 0) goto errhandler_io;
}
return True;
if (forceOverwrite) {
while (True) {
}
goto closeok;
}
switch (bzerr) {
case BZ_CONFIG_ERROR:
configError(); break;
case BZ_IO_ERROR:
ioError(); break;
case BZ_DATA_ERROR:
crcError();
case BZ_MEM_ERROR:
outOfMemory();
case BZ_UNEXPECTED_EOF:
case BZ_DATA_ERROR_MAGIC:
if (streamNo == 1) {
return False;
} else {
if (noisy)
"\n%s: %s: trailing garbage after EOF ignored\n",
return True;
}
default:
panic ( "decompress:unexpected error" );
}
panic ( "decompress:end" );
return True; /*notreached*/
}
/*---------------------------------------------*/
static
{
void* unusedTmpV;
nUnused = 0;
streamNo = 0;
while (True) {
bzf = BZ2_bzReadOpen (
);
streamNo++;
}
}
return True;
if (verbosity == 0)
switch (bzerr) {
case BZ_CONFIG_ERROR:
configError(); break;
case BZ_IO_ERROR:
ioError(); break;
case BZ_DATA_ERROR:
"data integrity (CRC) error in data\n" );
return False;
case BZ_MEM_ERROR:
outOfMemory();
case BZ_UNEXPECTED_EOF:
"file ends unexpectedly\n" );
return False;
case BZ_DATA_ERROR_MAGIC:
if (streamNo == 1) {
"bad magic number (file not created by bzip2)\n" );
return False;
} else {
if (noisy)
"trailing garbage after EOF ignored\n" );
return True;
}
default:
panic ( "test:unexpected error" );
}
panic ( "test:end" );
return True; /*notreached*/
}
/*---------------------------------------------------*/
/*--- Error [non-] handling grunge ---*/
/*---------------------------------------------------*/
/*---------------------------------------------*/
static
{
}
/*---------------------------------------------*/
static
void cadvise ( void )
{
if (noisy)
fprintf (
"\nIt is possible that the compressed file(s) have become corrupted.\n"
"You can use the -tvv option to test integrity of such files.\n\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
}
/*---------------------------------------------*/
static
void showFileNames ( void )
{
if (noisy)
fprintf (
"\tInput file = %s, output file = %s\n",
);
}
/*---------------------------------------------*/
static
{
&& deleteOutputOnInterrupt ) {
/* Check whether input file still exists. Delete output file
only if input exists to avoid loss of data. Joerg Prante, 5
January 2002. (JRS 06-Jan-2002: other changes in 1.0.2 mean
this is less likely to happen. But to be ultra-paranoid, we
do the check anyway.) */
if (retVal == 0) {
if (noisy)
"%s: Deleting output file %s, if it exists.\n",
if (outputHandleJustInCase != NULL)
if (retVal != 0)
"%s: WARNING: deletion of output file "
"(apparently) failed.\n",
progName );
} else {
"%s: WARNING: deletion of output file suppressed\n",
progName );
"%s: since input file no longer exists. Output file\n",
progName );
"%s: `%s' may be incomplete.\n",
"%s: I suggest doing an integrity test (bzip2 -tv)"
" of it.\n",
progName );
}
}
"%s: WARNING: some files have not been processed:\n"
"%s: %d specified on command line, %d not processed yet.\n\n",
}
}
/*---------------------------------------------*/
static
{
"\n%s: PANIC -- internal consistency error:\n"
"\t%s\n"
"\tThis is a BUG. Please report it to me at:\n"
"\tjseward@bzip.org\n",
progName, s );
cleanUpAndFail( 3 );
}
/*---------------------------------------------*/
static
void crcError ( void )
{
"\n%s: Data integrity error when decompressing.\n",
progName );
cadvise();
cleanUpAndFail( 2 );
}
/*---------------------------------------------*/
static
void compressedStreamEOF ( void )
{
if (noisy) {
"\n%s: Compressed file ends unexpectedly;\n\t"
"perhaps it is corrupted? *Possible* reason follows.\n",
progName );
cadvise();
}
cleanUpAndFail( 2 );
}
/*---------------------------------------------*/
static
void ioError ( void )
{
"\n%s: I/O or other error, bailing out. "
"Possible reason follows.\n",
progName );
cleanUpAndFail( 1 );
}
/*---------------------------------------------*/
static
void mySignalCatcher ( IntNative n )
{
"\n%s: Control-C or similar caught, quitting.\n",
progName );
cleanUpAndFail(1);
}
/*---------------------------------------------*/
static
void mySIGSEGVorSIGBUScatcher ( IntNative n )
{
fprintf (
"\n%s: Caught a SIGSEGV or SIGBUS whilst compressing.\n"
"\n"
" Possible causes are (most likely first):\n"
" (1) This computer has unreliable memory or cache hardware\n"
" (a surprisingly common problem; try a different machine.)\n"
" (2) A bug in the compiler used to create this executable\n"
" (unlikely, if you didn't compile bzip2 yourself.)\n"
" (3) A real bug in bzip2 -- I hope this should never be the case.\n"
" The user's manual, Section 4.3, has more info on (1) and (2).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (1)\n"
" or (2), feel free to report it to me at: jseward@bzip.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
" have the manual or can't be bothered to read it, mail me anyway.\n"
"\n",
progName );
else
fprintf (
"\n%s: Caught a SIGSEGV or SIGBUS whilst decompressing.\n"
"\n"
" Possible causes are (most likely first):\n"
" (1) The compressed data is corrupted, and bzip2's usual checks\n"
" failed to detect this. Try bzip2 -tvv my_file.bz2.\n"
" (2) This computer has unreliable memory or cache hardware\n"
" (a surprisingly common problem; try a different machine.)\n"
" (3) A bug in the compiler used to create this executable\n"
" (unlikely, if you didn't compile bzip2 yourself.)\n"
" (4) A real bug in bzip2 -- I hope this should never be the case.\n"
" The user's manual, Section 4.3, has more info on (2) and (3).\n"
" \n"
" If you suspect this is a bug in bzip2, or are unsure about (2)\n"
" or (3), feel free to report it to me at: jseward@bzip.org.\n"
" Section 4.3 of the user's manual describes the info a useful\n"
" bug report should have. If the manual is available on your\n"
" system, please try and read it before mailing me. If you don't\n"
" have the manual or can't be bothered to read it, mail me anyway.\n"
"\n",
progName );
cleanUpAndFail( 3 ); else
}
/*---------------------------------------------*/
static
void outOfMemory ( void )
{
"\n%s: couldn't allocate enough memory\n",
progName );
cleanUpAndFail(1);
}
/*---------------------------------------------*/
static
void configError ( void )
{
"bzip2: I'm not configured correctly for this platform!\n"
"\tI require Int32, Int16 and Char to have sizes\n"
"\tof 4, 2 and 1 bytes to run properly, and they don't.\n"
"\tProbably you can fix this by defining them correctly,\n"
"\tand recompiling. Bye!\n" );
setExit(3);
}
/*---------------------------------------------------*/
/*--- The main driver machinery ---*/
/*---------------------------------------------------*/
/* All rather crufty. The main problem is that input files
are stat()d multiple times before use. This should be
cleaned up.
*/
/*---------------------------------------------*/
static
{
Int32 i;
}
/*---------------------------------------------*/
static
{
fprintf (
"bzip2: file name\n`%s'\n"
"is suspiciously (more than %d chars) long.\n"
"Try using a reasonable file name instead. Sorry! :-)\n",
);
setExit(1);
}
}
/*---------------------------------------------*/
static
{
return exists;
}
/*---------------------------------------------*/
/* Open an output file safely with O_EXCL and good permissions.
This avoids a race condition in versions < 1.0.2, in which
the file was first opened and then had its interim permissions
set safely. We instead use open() to create the file with
the interim permissions required. (--- --- rw-).
For non-Unix platforms, if we are not worrying about
security issues, simple this simply behaves like fopen.
*/
static
{
# if BZ_UNIX
return fp;
# else
# endif
}
/*---------------------------------------------*/
/*--
if in doubt, return True
--*/
static
{
IntNative i;
if (i != 0) return True;
return True;
}
/*---------------------------------------------*/
/*--
rac 11/21/98 see if file has hard links to it
--*/
static
{
IntNative i;
if (i != 0) return 0;
}
/*---------------------------------------------*/
/* Copy modification date, access date, permissions and owner from the
source to destination file. We have to copy this meta-info off
into fileMetaInfo before starting to compress / decompress it,
because doing it afterwards means we get the wrong access time.
To complicate matters, in compress() and decompress() below, the
sequence of tests preceding the call to saveInputFileMetaInfo()
involves calling fileExists(), which in turn establishes its result
by attempting to fopen() the file, and if successful, immediately
fclose()ing it again. So we have to assume that the fopen() call
does not cause the access time field to be updated.
Reading of the man page for stat() (man 2 stat) on RedHat 7.2 seems
to imply that merely doing open() will not affect the access time.
Therefore we merely need to hope that the C library only does
open() as a result of fopen(), and not any kind of read()-ahead
cleverness.
It sounds pretty fragile to me. Whether this carries across
robustly to arbitrary Unix-like platforms (or even works robustly
on this one, RedHat 7.2) is unknown to me. Nevertheless ...
*/
#if BZ_UNIX
static
struct MY_STAT fileMetaInfo;
#endif
static
{
# if BZ_UNIX
/* Note use of stat here, not lstat. */
ERROR_IF_NOT_ZERO ( retVal );
# endif
}
static
{
# if BZ_UNIX
ERROR_IF_NOT_ZERO ( retVal );
# endif
}
static
{
# if BZ_UNIX
ERROR_IF_NOT_ZERO ( retVal );
/* chown() will in many cases return with EPERM, which can
be safely ignored.
*/
# endif
}
/*---------------------------------------------*/
static
{
# if BZ_UNIX
/* On unix, files can contain any characters and the file expansion
* is performed by the shell.
*/
return False;
# else /* ! BZ_UNIX */
/* On non-unix (Win* platforms), wildcard characters are not allowed in
* filenames.
*/
return False;
# endif /* BZ_UNIX */
}
/*---------------------------------------------*/
#define BZ_N_SUFFIX_PAIRS 4
= { ".bz2", ".bz", ".tbz2", ".tbz" };
= { "", "", ".tar", ".tar" };
static
{
return False;
}
static
{
return True;
}
/*---------------------------------------------*/
static
{
Int32 n, i;
panic ( "compress: bad modes\n" );
switch (srcMode) {
case SM_I2O:
break;
case SM_F2F:
break;
case SM_F2O:
break;
}
if (noisy)
setExit(1);
return;
}
setExit(1);
return;
}
for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) {
if (noisy)
"%s: Input file %s already has %s suffix.\n",
setExit(1);
return;
}
}
"%s: Input file %s is a directory.\n",
setExit(1);
return;
}
}
if (noisy)
setExit(1);
return;
}
if (forceOverwrite) {
} else {
setExit(1);
return;
}
}
(n=countHardLinks ( inName )) > 0) {
setExit(1);
return;
}
/* Save the file's meta-info before we open it. Doing it later
means we mess up the access times. */
}
switch ( srcMode ) {
case SM_I2O:
"%s: I won't write compressed data to a terminal.\n",
progName );
setExit(1);
return;
};
break;
case SM_F2O:
"%s: I won't write compressed data to a terminal.\n",
progName );
setExit(1);
return;
};
setExit(1);
return;
};
break;
case SM_F2F:
setExit(1);
return;
}
setExit(1);
return;
};
break;
default:
panic ( "compress: bad srcMode" );
break;
}
if (verbosity >= 1) {
}
/*--- Now the input and output handles are sane. Do the Biz. ---*/
/*--- If there was an I/O error, we won't get here. ---*/
if ( !keepInputFiles ) {
ERROR_IF_NOT_ZERO ( retVal );
}
}
}
/*---------------------------------------------*/
static
{
Int32 n, i;
panic ( "uncompress: bad modes\n" );
switch (srcMode) {
case SM_I2O:
break;
case SM_F2F:
for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++)
goto zzz;
break;
case SM_F2O:
break;
}
zzz:
if (noisy)
setExit(1);
return;
}
setExit(1);
return;
}
"%s: Input file %s is a directory.\n",
setExit(1);
return;
}
}
if (noisy)
setExit(1);
return;
}
if ( /* srcMode == SM_F2F implied && */ cantGuess ) {
if (noisy)
"%s: Can't guess original name for %s -- using %s\n",
/* just a warning, no return */
}
if (forceOverwrite) {
} else {
setExit(1);
return;
}
}
(n=countHardLinks ( inName ) ) > 0) {
setExit(1);
return;
}
/* Save the file's meta-info before we open it. Doing it later
means we mess up the access times. */
}
switch ( srcMode ) {
case SM_I2O:
"%s: I won't read compressed data from a terminal.\n",
progName );
setExit(1);
return;
};
break;
case SM_F2O:
setExit(1);
return;
};
break;
case SM_F2F:
setExit(1);
return;
}
setExit(1);
return;
};
break;
default:
panic ( "uncompress: bad srcMode" );
break;
}
if (verbosity >= 1) {
}
/*--- Now the input and output handles are sane. Do the Biz. ---*/
/*--- If there was an I/O error, we won't get here. ---*/
if ( magicNumberOK ) {
if ( !keepInputFiles ) {
ERROR_IF_NOT_ZERO ( retVal );
}
}
} else {
ERROR_IF_NOT_ZERO ( retVal );
}
}
if ( magicNumberOK ) {
if (verbosity >= 1)
} else {
setExit(2);
if (verbosity >= 1)
"%s: %s is not a bzip2 file.\n",
}
}
/*---------------------------------------------*/
static
{
panic ( "testf: bad modes\n" );
switch (srcMode) {
}
if (noisy)
setExit(1);
return;
}
setExit(1);
return;
}
"%s: Input file %s is a directory.\n",
setExit(1);
return;
}
}
switch ( srcMode ) {
case SM_I2O:
"%s: I won't read compressed data from a terminal.\n",
progName );
setExit(1);
return;
};
break;
setExit(1);
return;
};
break;
default:
panic ( "testf: bad srcMode" );
break;
}
if (verbosity >= 1) {
}
/*--- Now the input handle is sane. Do the Biz. ---*/
}
/*---------------------------------------------*/
static
void license ( void )
{
"bzip2, a block-sorting file compressor. "
"Version %s.\n"
" \n"
" Copyright (C) 1996-2010 by Julian Seward.\n"
" \n"
" it under the terms set out in the LICENSE file, which is included\n"
" in the bzip2-1.0.6 source distribution.\n"
" \n"
" This program is distributed in the hope that it will be useful,\n"
" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"
" LICENSE file for more details.\n"
" \n",
);
}
/*---------------------------------------------*/
static
{
fprintf (
"bzip2, a block-sorting file compressor. "
"Version %s.\n"
"\n usage: %s [flags and input files in any order]\n"
"\n"
" -h --help print this message\n"
" -d --decompress force decompression\n"
" -z --compress force compression\n"
" -k --keep keep (don't delete) input files\n"
" -f --force overwrite existing output files\n"
" -t --test test compressed file integrity\n"
" -c --stdout output to standard out\n"
" -q --quiet suppress noncritical error messages\n"
" -v --verbose be verbose (a 2nd -v gives more)\n"
" -L --license display software version & license\n"
" -V --version display software version & license\n"
" -s --small use less memory (at most 2500k)\n"
" -1 .. -9 set block size to 100k .. 900k\n"
" --fast alias for -1\n"
" --best alias for -9\n"
"\n"
" If invoked as `bzip2', default action is to compress.\n"
" as `bunzip2', default action is to decompress.\n"
" as `bzcat', default action is to decompress to stdout.\n"
"\n"
" If no file names are given, bzip2 compresses or decompresses\n"
" from standard input to standard output. You can combine\n"
" short flags, so `-v -4' means the same as -v4 or -4v, &c.\n"
# if BZ_UNIX
"\n"
# endif
,
);
}
/*---------------------------------------------*/
static
{
fprintf (
"%s: %s is redundant in versions 0.9.5 and above\n",
}
/*---------------------------------------------*/
/*--
All the garbage from here to main() is purely to
implement a linked list of command-line arguments,
into which main() copies argv[1 .. argc-1].
The purpose of this exercise is to facilitate
the expansion of wildcard characters * and ? in
filenames for OSs which don't know how to do it
themselves, like MSDOS, Windows 95 and NT.
The actual Dirty Work is done by the platform-
specific macro APPEND_FILESPEC.
--*/
typedef
struct zzzz {
}
Cell;
/*---------------------------------------------*/
static
{
void* p;
if (p == NULL) outOfMemory ();
return p;
}
/*---------------------------------------------*/
static
{
Cell *c;
return c;
}
/*---------------------------------------------*/
static
{
return tmp;
} else {
return root;
}
}
/*---------------------------------------------*/
static
{
Int32 i, j, k;
p = envbase;
i = 0;
while (True) {
if (p[i] == 0) break;
p += i;
i = 0;
if (i > 0) {
for (j = 0; j < k; j++) tmpName[j] = p[j];
tmpName[k] = 0;
}
}
}
}
/*---------------------------------------------*/
{
Int32 i, j;
/*-- Be really really really paranoid :-) --*/
configError();
/*-- Initialise --*/
verbosity = 0;
blockSize100k = 9;
numFileNames = 0;
numFilesProcessed = 0;
workFactor = 30;
exitValue = 0;
i = j = 0; /* avoid bogus warning from egcs-1.1.X */
/*-- Set up signal handlers for mem access errors --*/
# if BZ_UNIX
# ifndef __DJGPP__
# endif
# endif
progName = &progNameReally[0];
/*-- Copy flags from env var BZIP2, and
expand filename wildcards in arg list.
--*/
/*-- Find the length of the longest filename --*/
longestFileName = 7;
numFileNames = 0;
numFileNames++;
}
/*-- Determine source modes; flag handling may change this too. --*/
if (numFileNames == 0)
/*-- Determine what to do (compress/uncompress/test/cat). --*/
/*-- Note that subsequent flag handling may change this. --*/
}
/*-- Look at the flags. --*/
if (ISFLAG("--")) break;
case 'V':
case 'L': license(); break;
case 'v': verbosity++; break;
exit ( 0 );
break;
exit ( 1 );
break;
}
}
}
}
/*-- And again ... --*/
if (ISFLAG("--")) break;
else
exit ( 1 );
}
}
blockSize100k = 2;
progName );
exit ( 1 );
}
# if BZ_UNIX
# endif
}
} else {
}
}
}
else
uncompress ( NULL );
} else {
}
}
if (unzFailsExist) {
setExit(2);
}
}
else {
} else {
}
}
if (testFailsExist && noisy) {
"\n"
"You can use the `bzip2recover' program to attempt to recover\n"
"data from undamaged sections of corrupted files.\n\n"
);
setExit(2);
}
}
/* Free the argument list memory to mollify leak detectors
(eg) Purify, Checker. Serves no other useful purpose.
*/
}
return exitValue;
}
/*-----------------------------------------------------------*/
/*--- end bzip2.c ---*/
/*-----------------------------------------------------------*/