diff options
| author | simonb <simonb@NetBSD.org> | 1999-08-20 00:08:57 +0000 |
|---|---|---|
| committer | simonb <simonb@NetBSD.org> | 1999-08-20 00:08:57 +0000 |
| commit | 0678c8d4e57fa3cf309961f9b58277c4becabef6 (patch) | |
| tree | 04ca2cf3c2930f27b83aa51b9c80a12c23f5ded8 /gnu/usr.bin | |
| parent | fb292d7f02ec2bff8b09920fecf884c207355fb6 (diff) | |
In test mode, don't print the contents to stdout.
Patch from NAKAJIMA Yoshihiro in PR bin/8238.
Diffstat (limited to 'gnu/usr.bin')
| -rw-r--r-- | gnu/usr.bin/gzip/unbzip2.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gnu/usr.bin/gzip/unbzip2.c b/gnu/usr.bin/gzip/unbzip2.c index 07904a9d777..16b555a971b 100644 --- a/gnu/usr.bin/gzip/unbzip2.c +++ b/gnu/usr.bin/gzip/unbzip2.c @@ -2,7 +2,7 @@ */ #ifdef RCSID -static char rcsid[] = "$Id: unbzip2.c,v 1.1 1999/07/25 07:06:06 simonb Exp $"; +static char rcsid[] = "$Id: unbzip2.c,v 1.2 1999/08/20 00:08:57 simonb Exp $"; #endif #define BZ_NO_STDIO @@ -49,15 +49,18 @@ int unbzip2(in, out) ret = bzDecompress(&bzs); if (ret == BZ_STREAM_END) { - n = write(out, outbuf, OUTBUFSIZ - bzs.avail_out); - if (n < 0) - write_error(); + if (!test) { + n = write(out, outbuf, OUTBUFSIZ - bzs.avail_out); + if (n < 0) + write_error(); + } break; } else if (ret == BZ_OK) { if (end_of_file) read_error(); - n = write(out, outbuf, OUTBUFSIZ - bzs.avail_out); + if (!test) + n = write(out, outbuf, OUTBUFSIZ - bzs.avail_out); } else { switch (ret) { |
