From a1d170a0b61aa2bf5fb5f73f294f29dda17442f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20Sp=C3=B6rlein?= Date: Thu, 27 May 2010 12:59:49 +0000 Subject: [PATCH] mail(1) misses addresses when replying to all There's a parsing error for fields where addresses are not separated by space. This is often produced by MS Outlook, eg.: Cc: ,"Mr Foo" The following line now splits into the right tokens: Cc: f@b.com,z@y.de, ,, "foo" ,"bar" PR: bin/131861 Submitted by: Pete French Tested by: Pete French Reviewed by: mikeh MFC after: 2 weeks --- usr.bin/mail/util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/mail/util.c b/usr.bin/mail/util.c index df2d840428b..d8778ebe53c 100644 --- a/usr.bin/mail/util.c +++ b/usr.bin/mail/util.c @@ -496,10 +496,11 @@ skin(name) *cp2++ = ' '; } *cp2++ = c; - if (c == ',' && *cp == ' ' && !gotlt) { + if (c == ',' && !gotlt && + (*cp == ' ' || *cp == '"' || *cp == '<')) { *cp2++ = ' '; - while (*++cp == ' ') - ; + while (*cp == ' ') + cp++; lastsp = 0; bufend = cp2; }