[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-workers] weird behaviour of formataddr in repl

From: Peter Maydell
Subject: [Nmh-workers] weird behaviour of formataddr in repl
Date: Sun, 03 Aug 2008 12:24:51 +0100

While investigating the mh-format internals as part of evaluating Eric's
patch, I noticed this rather weird behaviour: the formataddr function
used when evaluating replcomps files ignores addresses it's already seen
before. So a replcomps like this:

%(lit)%(formataddr {from})%<(nonnull)%(void(width))%(putaddr X-one: )\n%>\
%(lit)%(formataddr {from})%<(nonnull)%(void(width))%(putaddr X-two: )\n%>

which ought to generate two headers with the from addr in them in
fact only generates the first.

This behaviour seems to have been in the sources since at least 1999;
does anybody have any idea why? My best guess is that the intended behaviour
is that if you use formataddr to build up a list of addresses it is supposed
to avoid putting duplicates in that list -- and this is a buggy attempt at
optimising that. But why is the behaviour for repl different from that for
everything else? (the code to weed out things seen before is only in the
custom implementation of formataddr() in uip/replsbr.c -- the generic
version in sbr/fmt_addr.c doesn't do this.)

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]