From: Reuben Thomas Date: Mon, 11 Feb 2008 23:20:51 +0000 (+0000) Subject: Fix Debian bug #407120 (Bug in relative use of search/regex), which is X-Git-Tag: FILE5_05~501 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e46b6a8fa9d9505888232802ad58cf3f840815b;p=file Fix Debian bug #407120 (Bug in relative use of search/regex), which is caused by relative offsets not working properly. --- diff --git a/src/softmagic.c b/src/softmagic.c index c482f07f..324a0a2f 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -38,7 +38,7 @@ #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.107 2008/02/11 22:11:24 rrt Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.108 2008/02/11 23:20:51 rrt Exp $") #endif /* lint */ private int match(struct magic_set *, struct magic *, uint32_t, @@ -187,11 +187,11 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, */ cont_level = m->cont_level; } - ms->offset = m->offset; if (m->flag & OFFADD) { ms->offset += ms->c.li[cont_level - 1].off; - } + } else + ms->offset = m->offset; #ifdef ENABLE_CONDITIONALS if (m->cond == COND_ELSE ||