From 5106ce89d050932c7ed3d5bf6a9d5fbff722ba47 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Wed, 25 May 2011 18:04:11 +0000 Subject: [PATCH] Fix a regression introduced with previous changeset: if output is stdout, do not check for symbolic link. --- usr.bin/gzip/gzip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/gzip/gzip.c b/usr.bin/gzip/gzip.c index 927493eced7d..217660ea2398 100644 --- a/usr.bin/gzip/gzip.c +++ b/usr.bin/gzip/gzip.c @@ -1782,7 +1782,8 @@ handle_pathname(char *path) } retry: - if (stat(path, &sb) != 0 || (fflag == 0 && lstat(path, &sb) != 0)) { + if (stat(path, &sb) != 0 || (fflag == 0 && cflag == 0 && + lstat(path, &sb) != 0)) { /* lets try .gz if we're decompressing */ if (dflag && s == NULL && errno == ENOENT) { len = strlen(path);