summaryrefslogtreecommitdiff
path: root/src/src/expand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/src/expand.c')
-rw-r--r--src/src/expand.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/src/expand.c b/src/src/expand.c
index fbb2dfb14..0a8c5fbc0 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -7151,11 +7151,12 @@ while (*s != 0)
uschar * t = parse_extract_address(sub, &error, &start, &end, &domain,
FALSE);
if (t)
- yield = c == EOP_DOMAIN
- ? string_cat(yield, t + domain)
- : c == EOP_LOCAL_PART && domain > 0
- ? string_catn(yield, t, domain - 1 )
- : string_cat(yield, t);
+ if (c != EOP_DOMAIN)
+ yield = c == EOP_LOCAL_PART && domain > 0
+ ? string_catn(yield, t, domain - 1)
+ : string_cat(yield, t);
+ else if (domain > 0)
+ yield = string_cat(yield, t + domain);
continue;
}