diff options
author | Elliott Hughes <enh@google.com> | 2017-02-15 17:23:19 -0800 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-02-16 15:48:00 -0600 |
commit | af92dfdad8b8f2e8d35a1959832a3b6939261d9f (patch) | |
tree | 68d806c82384735fc27602240e25898b3136834f | |
parent | e95731e93f569ec7266d78f01a43f8a5159d4968 (diff) | |
download | toybox-af92dfdad8b8f2e8d35a1959832a3b6939261d9f.tar.gz |
Teach file(1) about bzip2 files.
If we can read and write bzip2 files, we should be able to identify them
too...
-rw-r--r-- | toys/posix/file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/toys/posix/file.c b/toys/posix/file.c index bab59e57..c7c72cd1 100644 --- a/toys/posix/file.c +++ b/toys/posix/file.c @@ -249,6 +249,8 @@ static void do_regular_file(int fd, char *name, struct stat *sb) if (ver) xprintf(", requires at least v%d.%d to extract", ver/10, ver%10); xputc('\n'); + } else if (len>4 && strstart(&s, "BZh") && isdigit(*s)) { + xprintf("bzip2 compressed data, block size = %c00k\n", *s); } else { char *what = 0; int i, bytes; |