diff options
author | Rob Landley <rob@landley.net> | 2017-04-03 15:48:21 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-04-03 15:48:21 -0500 |
commit | d1c664a31b656c1541c79044aa44467420f78f14 (patch) | |
tree | 042ea81214500cd563e690ad313e077c3b1956b6 /toys | |
parent | 385a237e40f6d9dab2829611d124a09ee80c5e17 (diff) | |
download | toybox-d1c664a31b656c1541c79044aa44467420f78f14.tar.gz |
Add gzip support. (Doesn't show source OS and timestamp, but reporting them
isn't obviously useful.)
Diffstat (limited to 'toys')
-rw-r--r-- | toys/posix/file.c | 3 |
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; |