From: Christos Zoulas Date: Fri, 27 Mar 2009 22:42:49 +0000 (+0000) Subject: don't print \012- separators in the same magic entry if it consists of multiple X-Git-Tag: FILE5_05~215 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15d355a7742b0c1c170be3a840ce7f4263c15dab;p=file don't print \012- separators in the same magic entry if it consists of multiple print statemens. --- diff --git a/src/softmagic.c b/src/softmagic.c index 02ad1fdf..88f52145 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.134 2009/03/10 20:52:50 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.135 2009/03/27 22:42:49 christos Exp $") #endif /* lint */ #include "magic.h" @@ -256,11 +256,14 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, * make sure that we have a separator first. */ if (*m->desc) { - printed_something = 1; if ((e = handle_annotation(ms, m)) != 0) return e; - if (print_sep(ms, firstline) == -1) - return -1; + if (!printed_something) { + printed_something = 1; + if (print_sep(ms, firstline) + == -1) + return -1; + } } /* * This continuation matched. Print