X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Freplsbr.c;h=9ca0bb94f72dbaf7a5f296813f1b84e2751e195f;hb=f5e7506daeb8f52e02348504fb1699284b299f25;hp=3dda47089c543d0ef823e74cc3c153f2f18948fa;hpb=5dd6771b28c257af405d7248639ed0e3bcdce38b;p=mmh diff --git a/uip/replsbr.c b/uip/replsbr.c index 3dda470..9ca0bb9 100644 --- a/uip/replsbr.c +++ b/uip/replsbr.c @@ -25,6 +25,7 @@ static char *badaddrs = NULL; static char *dfhost = NULL; static struct mailname mq = { NULL }; +static int nodupcheck = 0; /* If set, no check for duplicates */ /* * Buffer size for content part of header fields. @@ -380,12 +381,38 @@ formataddr (char *orig, char *str) } +/* + * fmt_scan will call this routine if the user includes the function + * "(concataddr {component})" in a format string. This behaves exactly + * like formataddr, except that it does NOT suppress duplicate addresses + * between calls. + * + * As an implementation detail: I thought about splitting out formataddr() + * into the generic part and duplicate-suppressing part, but the call to + * insert() was buried deep within a couple of loops and I didn't see a + * way to do it easily. So instead we simply set a special flag to stop + * the duplicate check and call formataddr(). + */ +char * +concataddr(char *orig, char *str) +{ + char *cp; + + nodupcheck = 1; + cp = formataddr(orig, str); + nodupcheck = 0; + return cp; +} + static int insert (struct mailname *np) { char buffer[BUFSIZ]; register struct mailname *mp; + if (nodupcheck) + return 1; + if (np->m_mbox == NULL) return 0;