]> granicus.if.org Git - file/commitdiff
PR/319: Remove superfluous call to file_ascmagic_with_encoding. file_encoding
authorChristos Zoulas <christos@zoulas.com>
Fri, 14 Mar 2014 19:02:37 +0000 (19:02 +0000)
committerChristos Zoulas <christos@zoulas.com>
Fri, 14 Mar 2014 19:02:37 +0000 (19:02 +0000)
should have set looks_text correctly before, and file_ascmagic already calls
file_ascmagic_with_encoding if it needs to.

src/funcs.c

index fe1d70d8955753cdb21b032df00423c99ced00f1..863871d7d047d9ffa6b1ad968f095349a270268c 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.68 2014/02/18 11:09:31 kim Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.69 2014/03/06 16:03:39 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -263,19 +263,6 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((unu
                                (void)fprintf(stderr, "ascmagic %d\n", m);
                        goto done;
                }
-
-               /* try to discover text encoding */
-               if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
-                       if (looks_text == 0)
-                               if ((m = file_ascmagic_with_encoding( ms, ubuf,
-                                   nb, u8buf, ulen, code, ftype, looks_text))
-                                   != 0) {
-                                       if ((ms->flags & MAGIC_DEBUG) != 0)
-                                               (void)fprintf(stderr,
-                                                   "ascmagic/enc %d\n", m);
-                                       goto done;
-                               }
-               }
        }
 
 simple: