]> granicus.if.org Git - file/commitdiff
revert previous: we cannot default for mime/apple/etc on the first printed desc,
authorChristos Zoulas <christos@zoulas.com>
Tue, 21 Aug 2018 08:58:16 +0000 (08:58 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 21 Aug 2018 08:58:16 +0000 (08:58 +0000)
because they might be overriden later.

src/softmagic.c

index ac86d92d0781905298495dcfdb31bc8bb4c745e5..27b293d22e6fe7ff24829363e48cf821d3b96f7f 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.268 2018/08/20 12:21:39 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.269 2018/08/21 08:58:16 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -61,8 +61,7 @@ private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
     const unsigned char *, uint32_t, size_t, struct magic *);
 private int mconvert(struct magic_set *, struct magic *, int);
 private int print_sep(struct magic_set *, int);
-private int handle_annotation(struct magic_set *, struct magic *, int,
-    uint16_t);
+private int handle_annotation(struct magic_set *, struct magic *, int);
 private int cvt_8(union VALUETYPE *, const struct magic *);
 private int cvt_16(union VALUETYPE *, const struct magic *);
 private int cvt_32(union VALUETYPE *, const struct magic *);
@@ -239,7 +238,7 @@ flush:
                        goto flush;
                }
 
-               if ((e = handle_annotation(ms, m, firstline, *name_count)) != 0)
+               if ((e = handle_annotation(ms, m, firstline)) != 0)
                {
                        *need_separator = 1;
                        *printed_something = 1;
@@ -338,8 +337,8 @@ flush:
                                } else
                                        ms->c.li[cont_level].got_match = 1;
 
-                               if ((e = handle_annotation(ms, m, firstline,
-                                   *name_count)) != 0) {
+                               if ((e = handle_annotation(ms, m, firstline))
+                                   != 0) {
                                        *need_separator = 1;
                                        *printed_something = 1;
                                        *returnval = 1;
@@ -2179,8 +2178,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
 }
 
 private int
-handle_annotation(struct magic_set *ms, struct magic *m, int firstline,
-    uint16_t name_count)
+handle_annotation(struct magic_set *ms, struct magic *m, int firstline)
 {
        if ((ms->flags & MAGIC_APPLE) && m->apple[0]) {
                if (print_sep(ms, firstline) == -1)
@@ -2209,9 +2207,7 @@ handle_annotation(struct magic_set *ms, struct magic *m, int firstline,
                        return -1;
                return 1;
        }
-       if (!*m->desc || name_count)
-               return 0;
-       return file_default(ms, 1);
+       return 0;
 }
 
 private int