diff options
author | obrien <obrien@FreeBSD.org> | 2012-04-13 23:30:38 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2012-04-13 23:30:38 +0000 |
commit | 15f98df7891f1853090ecb6c4a9cc734e671ef6b (patch) | |
tree | 76d27a13085cbcecae404c91dc1a6e03fc5c5d7b /funcs.c | |
parent | 75c49f9dd6a0ff710f7c791a485899c7a07af444 (diff) | |
download | FreeBSD-src-15f98df7891f1853090ecb6c4a9cc734e671ef6b.zip FreeBSD-src-15f98df7891f1853090ecb6c4a9cc734e671ef6b.tar.gz |
Virgin import of Christos Zoulas's FILE 5.11.
Diffstat (limited to 'funcs.c')
-rw-r--r-- | funcs.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -27,7 +27,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: funcs.c,v 1.57 2011/05/11 01:02:41 christos Exp $") +FILE_RCSID("@(#)$File: funcs.c,v 1.60 2011/12/08 12:38:24 rrt Exp $") #endif /* lint */ #include "magic.h" @@ -228,7 +228,8 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu /* try soft magic tests */ if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) - if ((m = file_softmagic(ms, ubuf, nb, BINTEST)) != 0) { + if ((m = file_softmagic(ms, ubuf, nb, BINTEST, + looks_text)) != 0) { if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, "softmagic %d\n", m); #ifdef BUILTIN_ELF @@ -252,10 +253,10 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu goto done; } - /* try text properties (and possibly text tokens) */ + /* try text properties */ if ((ms->flags & MAGIC_NO_CHECK_TEXT) == 0) { - if ((m = file_ascmagic(ms, ubuf, nb)) != 0) { + if ((m = file_ascmagic(ms, ubuf, nb, looks_text)) != 0) { if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, "ascmagic %d\n", m); goto done; @@ -265,7 +266,8 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) { if (looks_text == 0) if ((m = file_ascmagic_with_encoding( ms, ubuf, - nb, u8buf, ulen, code, type)) != 0) { + nb, u8buf, ulen, code, type, looks_text)) + != 0) { if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, "ascmagic/enc %d\n", m); @@ -288,8 +290,7 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu if (file_printf(ms, "%s", code_mime) == -1) rv = -1; } - if (u8buf) - free(u8buf); + free(u8buf); if (rv) return rv; |