X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/e7e55c1c2d1d6f4436800ea588ab47f7326169d3..d8b76fa95c55331db4f475ee34caa7e8725ec421:/src/src/expand.c diff --git a/src/src/expand.c b/src/src/expand.c index cd9b48c23..6478920f8 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -4733,7 +4733,7 @@ while (*s) skipping, but "break" otherwise so we get debug output for the item expansion. */ { - int start = yield->ptr; + int start = gstring_length(yield); switch(item_type) { /* Call an ACL from an expansion. We feed data in via $acl_arg1 - $acl_arg9. @@ -5956,8 +5956,7 @@ while (*s) /* Copy the characters before the match, plus the expanded insertion. */ - if (ovec[0] > moffset) - yield = string_catn(yield, subject + moffset, ovec[0] - moffset); + yield = string_catn(yield, subject + moffset, ovec[0] - moffset); if (!(insert = expand_string(sub[2]))) goto EXPAND_FAILED; @@ -7013,7 +7012,7 @@ while (*s) /*NOTREACHED*/ DEBUG(D_expand) - if (start > 0 || *s) /* only if not the sole expansion of the line */ + if (yield && (start > 0 || *s)) /* only if not the sole expansion of the line */ debug_expansion_interim(US"item-res", yield->s + start, yield->ptr - start, skipping); continue;