From cf0d80b4564ad2b7426ad7542f6de7f34f29eff5 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 5 Jan 2015 20:21:30 +0000 Subject: [PATCH] Fix: perl -e 'print "\x0" x 8, "bad", "\x0" x 1013, "H+", "\x0" x 6, "good"' | ./file printing bad... Reset the continuation offset. From Christoph Biedl --- src/softmagic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/softmagic.c b/src/softmagic.c index d35763fc..166c110d 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.208 2015/01/05 00:16:01 christos Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.209 2015/01/05 20:05:39 christos Exp $") #endif /* lint */ #include "magic.h" @@ -361,6 +361,7 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, if ((ms->flags & MAGIC_CONTINUE) == 0 && *printed_something) { return *returnval; /* don't keep searching */ } + cont_level = 0; } return *returnval; /* This is hit if -k is set or there is no match */ } -- 2.40.0