]> git.ipfire.org Git - people/ms/dma.git/commitdiff
parse_addrs: fix parsing for multiple <addresses>
authorSimon Schubert <2@0x2c.org>
Sat, 9 Jul 2011 00:34:53 +0000 (02:34 +0200)
committerSimon Schubert <2@0x2c.org>
Sat, 9 Jul 2011 00:34:53 +0000 (02:34 +0200)
We would treat [,;] as address separator, triggering a new recipient.
However, if the previous recipient was enclosed in <brackets>, we
already added this recipient.  Fix this by skipping over [,;] if the
current address is empty.

Bug: #807712 <https://bugs.launchpad.net/dma/+bug/807712>

mail.c

diff --git a/mail.c b/mail.c
index 398443986b0b3831ea8fcd53ee948adcddbc789e..e0a22af19c8d55a57a21711525a4158aa506a2ad 100644 (file)
--- a/mail.c
+++ b/mail.c
@@ -290,6 +290,16 @@ again:
 
                case ',':
                case ';':
+                       /*
+                        * Next address, copy previous one.
+                        * However, we might be directly after
+                        * a <address>, or have two consecutive
+                        * commas.
+                        * Skip the comma unless there is
+                        * really something to copy.
+                        */
+                       if (ps->pos == 0)
+                               goto skip;
                        s++;
                        goto newaddr;