diff options
author | 2003-07-29 18:33:11 +0000 | |
---|---|---|
committer | 2003-07-29 18:33:11 +0000 | |
commit | e899e832d254e31c63f909590f202affb86d2db2 (patch) | |
tree | 405a886fb0ed4a9dbfabf66b585331c4e1e8d4b5 | |
parent | fix length for "- stalled -" (diff) | |
download | wireguard-openbsd-e899e832d254e31c63f909590f202affb86d2db2.tar.xz wireguard-openbsd-e899e832d254e31c63f909590f202affb86d2db2.zip |
Instead of checking for "stdout" in decompress(), just do the check
in list_stats(). Looks cleaner and we don't have to rely on any
special flags being set.
-rw-r--r-- | usr.bin/compress/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c index 1177ec98eab..16c9bf0a5e3 100644 --- a/usr.bin/compress/main.c +++ b/usr.bin/compress/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.42 2003/07/29 07:09:07 millert Exp $ */ +/* $OpenBSD: main.c,v 1.43 2003/07/29 18:33:11 millert Exp $ */ static const char copyright[] = "@(#) Copyright (c) 1992, 1993\n\ @@ -35,7 +35,7 @@ static const char license[] = #if 0 static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94"; #else -static const char main_rcsid[] = "$OpenBSD: main.c,v 1.42 2003/07/29 07:09:07 millert Exp $"; +static const char main_rcsid[] = "$OpenBSD: main.c,v 1.43 2003/07/29 18:33:11 millert Exp $"; #endif #endif /* not lint */ @@ -628,7 +628,7 @@ decompress(const char *in, char *out, const struct compressor *method, if (list) { if (info.mtime == 0) info.mtime = (u_int32_t)sb->st_mtime; - list_stats(cat ? "stdout" : out, method, &info); + list_stats(out, method, &info); } else if (verbose > 0) { verbose_info(out, info.total_in, info.total_out, info.hlen); @@ -756,6 +756,9 @@ list_stats(const char *name, const struct compressor *method, static u_int nruns; char *timestr; + if (name != NULL && strcmp(name, "/dev/stdout") == 0) + name += 5; + if (nruns == 0) { if (verbose >= 0) { if (verbose > 0) |