summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-09-05 20:41:48 +0000
committerhenning <henning@openbsd.org>2003-09-05 20:41:48 +0000
commit527ac12e3d599fc103f4697ce42b479441d89dd7 (patch)
treefa9155ff1432f9916272052eacaec583cc2b9552
parentStop the bounds checker warning on a bound of 0, so now it only triggers (diff)
downloadwireguard-openbsd-527ac12e3d599fc103f4697ce42b479441d89dd7.tar.xz
wireguard-openbsd-527ac12e3d599fc103f4697ce42b479441d89dd7.zip
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;