The patch titled scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses-v2 has been added to the -mm tree. Its filename is scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses-v2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses-v2 From: Joe Perches <joe@xxxxxxxxxxx> nfi what changed Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Cc: Matt Mackall <mpm@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/get_maintainer.pl | 39 +++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff -puN scripts/get_maintainer.pl~scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses-v2 scripts/get_maintainer.pl --- a/scripts/get_maintainer.pl~scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses-v2 +++ a/scripts/get_maintainer.pl @@ -257,7 +257,7 @@ foreach my $file (@ARGV) { } } if ($file_emails) { - my @poss_addr = $text =~ m$[A-Za-z�-ÿ\"\' \,\.\+-]*\s*[\(\<][A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+[\)\>]$g; + my @poss_addr = $text =~ m$[A-Za-z�-ÿ\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+\.[A-Za-z0-9]+[\)\>\}]{0,1}$g; push(@file_emails, clean_file_emails(@poss_addr)); } } @@ -1128,25 +1128,46 @@ sub clean_file_emails { my @fmt_emails = (); foreach my $email (@file_emails) { - $email =~ s/\(/\</g; - $email =~ s/\)/\>/g; + $email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g; my ($name, $address) = parse_email($email); - my @nw = split(/[^A-Za-z�-ÿ\"\'\,\.\+-]/, $name); + if ($name eq '"[,\.]"') { + $name = ""; + } + + my @nw = split(/[^A-Za-z�-ÿ\'\,\.\+-]/, $name); if (@nw > 2) { - if ((length($nw[@nw - 2]) == 2) && - substr($nw[@nw - 2], 1) eq ".") { - $name = "$nw[@nw - 3] $nw[@nw - 2] $nw[@nw - 1]"; + my $first = $nw[@nw - 3]; + my $middle = $nw[@nw - 2]; + my $last = $nw[@nw - 1]; + + if (((length($first) == 1 && $first =~ m/[A-Za-z]/) || + (length($first) == 2 && substr($first, -1) eq ".")) || + (length($middle) == 1 || + (length($middle) == 2 && substr($middle, -1) eq "."))) { + $name = "$first $middle $last"; } else { - $name = "$nw[@nw - 2] $nw[@nw - 1]"; + $name = "$middle $last"; } } + + if (substr($name, -1) =~ /[,\.]/) { + $name = substr($name, 0, length($name) - 1); + } elsif (substr($name, -2) =~ /[,\.]"/) { + $name = substr($name, 0, length($name) - 2) . '"'; + } + + if (substr($name, 0, 1) =~ /[,\.]/) { + $name = substr($name, 1, length($name) - 1); + } elsif (substr($name, 0, 2) =~ /"[,\.]/) { + $name = '"' . substr($name, 2, length($name) - 2); + } + my $fmt_email = format_email($name, $address, $email_usename); push(@fmt_emails, $fmt_email); } return @fmt_emails; } - sub merge_email { my @lines; my %saw; _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are linux-next.patch net-rds-remove-uses-of-nipquad-use-%pi4.patch net-sunrpc-remove-uses-of-nipquad-use-%pi4.patch fs-ocfs2-cluster-tcpc-remove-use-of-nipquad-use-%pi4.patch drivers-scsi-correct-the-size-argument-to-kmalloc.patch drivers-scsi-remove-uses-of-nipquad-use-%pi4.patch drivers-firmware-iscsi_ibftc-remove-nipquad_fmt-use-%pi4.patch drivers-staging-pohmelfs-inodec-remove-uses-of-nipquad-use-%pi4.patch scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses.patch scripts-get_maintainerpl-add-file-emails-find-embedded-email-addresses-v2.patch scripts-checkpatchpl-add-warn-on-sizeof.patch checkpatchpl-allow-80-char-lines-for-logging-functions-not-just-printk.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html