Enable quilt mail to handle email addresses like

        "Zhu, Yi" <[email protected]>, "Li, Shaohua" <[email protected]>

Here the comma inside the double quotes should not be interpreted.

Signed-off-by: Wu Fengguang <[email protected]>
---
--- quilt/scripts/edmail.orig   2008-12-13 10:40:36.000000000 +0800
+++ quilt/scripts/edmail        2008-12-15 10:41:27.000000000 +0800
@@ -7,6 +7,7 @@
 #            Message Header Extensions for Non-ASCII Text
 
 use Getopt::Long;
+use Text::ParseWords;
 use strict;
 
 # This ugly trick lets the script work even if gettext support is missing.
@@ -121,6 +122,12 @@ sub check_recipient($) {
     }
 }
 
+sub split_addrs($) {
+    my ($addrs) = @_;
+
+    return &quotewords('\s*,\s*', 1, $addrs);
+}
+
 my %recipients;
 sub process_header($) {
     local ($_) = @_;
@@ -135,7 +142,7 @@ sub process_header($) {
        if (exists $extract_recipients_from{lc $name}) {
            #print "(($value))";
            $value =~ s/^\s*//;  $value =~ s/\s*$//;
-           foreach my $recipient (split /\s*,\s*/s, $value) {
+           foreach my $recipient (split_addrs($value)) {
                    next if $recipient =~ /^\s*$/;
                    #print "<<$recipient>>";
                    my $deliver;
@@ -162,7 +169,7 @@ sub process_header($) {
        # This is a recipients field. Split out all the recipients and
        # check the addresses. Suppress duplicate recipients.
        $value =~ s/^\s*//;  $value =~ s/\s*$//;
-       foreach my $recipient (split /\s*,\s*/, $value) {
+       foreach my $recipient (split_addrs($value)) {
            next if $recipient =~ /^\s*$/;
            my $deliver;
            ($recipient, $deliver) = check_recipient($recipient);


_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to