aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-02-15 17:23:19 -0800
committerRob Landley <rob@landley.net>2017-02-16 15:48:00 -0600
commitaf92dfdad8b8f2e8d35a1959832a3b6939261d9f (patch)
tree68d806c82384735fc27602240e25898b3136834f
parente95731e93f569ec7266d78f01a43f8a5159d4968 (diff)
downloadtoybox-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.c2
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;