aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2017-04-03 15:48:21 -0500
committerRob Landley <rob@landley.net>2017-04-03 15:48:21 -0500
commitd1c664a31b656c1541c79044aa44467420f78f14 (patch)
tree042ea81214500cd563e690ad313e077c3b1956b6
parent385a237e40f6d9dab2829611d124a09ee80c5e17 (diff)
downloadtoybox-d1c664a31b656c1541c79044aa44467420f78f14.tar.gz
Add gzip support. (Doesn't show source OS and timestamp, but reporting them
isn't obviously useful.)
-rw-r--r--toys/posix/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toys/posix/file.c b/toys/posix/file.c
index c7c72cd1..e52e884f 100644
--- a/toys/posix/file.c
+++ b/toys/posix/file.c
@@ -251,7 +251,8 @@ static void do_regular_file(int fd, char *name, struct stat *sb)
xputc('\n');
} else if (len>4 && strstart(&s, "BZh") && isdigit(*s)) {
xprintf("bzip2 compressed data, block size = %c00k\n", *s);
- } else {
+ } else if (len>10 && strstart(&s, "\x1f\x8b")) xputs("gzip compressed data");
+ else {
char *what = 0;
int i, bytes;