diff options
Diffstat (limited to 'src/is_tar.c')
-rw-r--r-- | src/is_tar.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/is_tar.c b/src/is_tar.c index a9311117..98ff7371 100644 --- a/src/is_tar.c +++ b/src/is_tar.c @@ -45,7 +45,7 @@ #include "tar.h" #ifndef lint -FILE_RCSID("@(#)$File: is_tar.c,v 1.31 2008/02/04 20:51:17 christos Exp $") +FILE_RCSID("@(#)$File: is_tar.c,v 1.32 2008/10/18 20:47:48 christos Exp $") #endif #define isodigit(c) ( ((c) >= '0') && ((c) <= '7') ) @@ -66,13 +66,14 @@ file_is_tar(struct magic_set *ms, const unsigned char *buf, size_t nbytes) * Do the tar test first, because if the first file in the tar * archive starts with a dot, we can confuse it with an nroff file. */ - int tar = is_tar(buf, nbytes); + int tar; int mime = ms->flags & MAGIC_MIME; - if (tar < 1 || tar > 3) + if ((ms->flags & MAGIC_APPLE) != 0 || mime == MAGIC_MIME_ENCODING) return 0; - if (mime == MAGIC_MIME_ENCODING) + tar = is_tar(buf, nbytes); + if (tar < 1 || tar > 3) return 0; if (file_printf(ms, mime ? "application/x-tar" : |