From 4da1ca9e76b41defb7d9624e859a90302f433ec8 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Mon, 11 Feb 2008 23:20:51 +0000 Subject: [PATCH] Fix Debian bug #407120 (Bug in relative use of search/regex), which is caused by relative offsets not working properly. --- src/softmagic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/softmagic.c b/src/softmagic.c index 6c8e5621..91d252d5 100644 --- a/src/softmagic.c +++ b/src/softmagic.c @@ -38,7 +38,7 @@ #ifndef lint -FILE_RCSID("@(#)$File: softmagic.c,v 1.106 2008/02/11 01:02:11 rrt Exp $") +FILE_RCSID("@(#)$File: softmagic.c,v 1.107 2008/02/11 22:11:24 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 || -- 2.50.0