summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-09-05 20:41:49 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-09-05 20:41:49 +0000
commit6c4a6354e5979a32f58660e2c88b48627a307a46 (patch)
tree3caa7e1f80cc1c569d71b960407336ada17c9db6
parent2fd7d416ccfdb678771bbbd8c00c8b51cbd5fec8 (diff)
dont error out when the input file is a symlink AND output goes to stdout
inspired by PR3409, ckuethe@ualberta.ca, tho fixed differently matches gnu gzip behaviour ok millert@ tedu@ deraadt@
-rw-r--r--usr.bin/compress/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c
index 2303928b674..9f5a18747a4 100644
--- a/usr.bin/compress/main.c
+++ b/usr.bin/compress/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.45 2003/09/05 04:46:35 tedu Exp $ */
+/* $OpenBSD: main.c,v 1.46 2003/09/05 20:41:48 henning Exp $ */
static const char copyright[] =
"@(#) Copyright (c) 1992, 1993\n\
@@ -37,7 +37,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.45 2003/09/05 04:46:35 tedu Exp $";
+static const char main_rcsid[] = "$OpenBSD: main.c,v 1.46 2003/09/05 20:41:48 henning Exp $";
#endif
#endif /* not lint */
@@ -366,7 +366,8 @@ main(int argc, char *argv[])
rc = rc ? rc : WARNING;
continue;
default:
- if (!S_ISREG(entry->fts_statp->st_mode) && !pipin) {
+ if (!S_ISREG(entry->fts_statp->st_mode) && !pipin
+ && !(S_ISLNK(entry->fts_statp->st_mode) && cat)) {
warnx("%s not a regular file%s",
infile, cat ? "" : ": unchanged");
rc = rc ? rc : WARNING;