summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2008-11-07 17:25:59 +0000
committerChristos Zoulas <christos@zoulas.com>2008-11-07 17:25:59 +0000
commitd8328b238db319f3e9cf48f971b807e4f532d0e7 (patch)
tree921cb0136970958c1a4cdd15ebb42b3575b6d411 /src
parentc5c7ffcf1faa731cee6e42ae7756f51c9a315ddf (diff)
downloadfile-git-d8328b238db319f3e9cf48f971b807e4f532d0e7.tar.gz
when -i don't print application/x-directorybinary.
Diffstat (limited to 'src')
-rw-r--r--src/fsmagic.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fsmagic.c b/src/fsmagic.c
index a974d9e5..e52496c3 100644
--- a/src/fsmagic.c
+++ b/src/fsmagic.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.54 2008/10/18 20:47:48 christos Exp $")
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.55 2008/11/04 16:38:28 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -88,9 +88,13 @@ bad_link(struct magic_set *ms, int err, char *buf)
private int
handle_mime(struct magic_set *ms, int mime, const char *str)
{
- if ((mime & MAGIC_MIME_TYPE) && file_printf(ms, "application/%s", str)
- == -1)
- return -1;
+ if ((mime & MAGIC_MIME_TYPE)) {
+ if (file_printf(ms, "application/%s", str) == -1)
+ return -1;
+ if ((mime & MAGIC_MIME_ENCODING) && file_printf(ms,
+ "; encoding=") == -1)
+ return -1;
+ }
if ((mime & MAGIC_MIME_ENCODING) && file_printf(ms, "binary") == -1)
return -1;
return 0;