]> granicus.if.org Git - file/commitdiff
PR/20: Tar files with --mime-encoding shoukd not print mime type
authorChristos Zoulas <christos@zoulas.com>
Wed, 1 Aug 2018 08:50:20 +0000 (08:50 +0000)
committerChristos Zoulas <christos@zoulas.com>
Wed, 1 Aug 2018 08:50:20 +0000 (08:50 +0000)
src/is_tar.c

index 7110604f9e81bc00fd5a21cdca3f294208c5446f..8c8158210156d18cb624ae76b83a8594d7ef1566 100644 (file)
@@ -40,7 +40,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: is_tar.c,v 1.41 2017/11/02 20:25:39 christos Exp $")
+FILE_RCSID("@(#)$File: is_tar.c,v 1.42 2018/08/01 08:50:20 christos Exp $")
 #endif
 
 #include "magic.h"
@@ -78,9 +78,13 @@ file_is_tar(struct magic_set *ms, const struct buffer *b)
        if (tar < 1 || tar > 3)
                return 0;
 
+       if (mime == MAGIC_MIME_ENCODING)
+               return 1;
+
        if (file_printf(ms, "%s", mime ? "application/x-tar" :
            tartype[tar - 1]) == -1)
                return -1;
+
        return 1;
 }