From: Christos Zoulas Date: Thu, 9 May 2019 18:58:57 +0000 (+0000) Subject: Arrange to print separators if we keep going. X-Git-Tag: FILE5_37~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e9dcf5a6224a709cfa6fab38a5a0b7481e4afb1;p=file Arrange to print separators if we keep going. --- diff --git a/src/softmagic.c b/src/softmagic.c index e1495a4a..82948e63 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.284 2019/05/07 02:27:11 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.285 2019/05/09 18:58:57 christos Exp $") #endif /* lint */ #include "magic.h" @@ -448,8 +448,12 @@ flush: if (*printed_something) { firstline = 0; } - if ((ms->flags & MAGIC_CONTINUE) == 0 && *found_match) { + if (*found_match) { + if ((ms->flags & MAGIC_CONTINUE) == 0) return *returnval; /* don't keep searching */ + // So that we print a separator + *printed_something = 0; + firstline = 0; } cont_level = 0; }