From: Reuben Thomas Date: Tue, 12 Feb 2008 15:28:39 +0000 (+0000) Subject: Fix change made yesterday to correctly update offset for both indirect X-Git-Tag: pre-rrt-big-changes-post-4-23~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=baed05b085d25c0f07792156bd84817de06159fa;p=file Fix change made yesterday to correctly update offset for both indirect and non-indirect offsets. --- diff --git a/src/softmagic.c b/src/softmagic.c index 91d252d5..6a7c38a5 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,12 @@ match(struct magic_set *ms, struct magic *magic, uint32_t nmagic, */ cont_level = m->cont_level; } + if (!(magic[magindex - 1].flag & OFFADD)) + 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 ||