aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/lsb/gzip.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/toys/lsb/gzip.c b/toys/lsb/gzip.c
index 3038495e..049285af 100644
--- a/toys/lsb/gzip.c
+++ b/toys/lsb/gzip.c
@@ -78,6 +78,7 @@ static int do_deflate(int in_fd, int out_fd, int dd, int level)
}
if (!(gz = gzdopen(dd ? in_fd : out_fd, b))) perror_exit("gzdopen");
if (dd) {
+ if (gzdirect(gz)) error_exit("not gzip");
while ((len = gzread(gz, toybuf, sizeof(toybuf))) > 0)
if (len != writeall(out_fd, toybuf, len)) break;
} else {