]> granicus.if.org Git - file/commitdiff
Arrange to print separators if we keep going.
authorChristos Zoulas <christos@zoulas.com>
Thu, 9 May 2019 18:58:57 +0000 (18:58 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 9 May 2019 18:58:57 +0000 (18:58 +0000)
src/softmagic.c

index e1495a4acccef63cbb6c514839002d760974021a..82948e6357d449680c9de51be8ba2e8f10b403b5 100644 (file)
@@ -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;
        }