@@ -880,77 +880,6 @@ sub ident_person {
880
880
return " $ident [0] <$ident [1]>" ;
881
881
}
882
882
883
- =item parse_mailboxes
884
-
885
- Return an array of mailboxes extracted from a string.
886
-
887
- =cut
888
-
889
- # Very close to Mail::Address's parser, but we still have minor
890
- # differences in some cases (see t9000 for examples).
891
- sub parse_mailboxes {
892
- my $re_comment = qr /\( (?:[^)]*)\) / ;
893
- my $re_quote = qr / "(?:[^\"\\ ]|\\ .)*"/ ;
894
- my $re_word = qr / (?:[^]["\s ()<>:;@\\ ,.]|\\ .)+/ ;
895
-
896
- # divide the string in tokens of the above form
897
- my $re_token = qr / (?:$re_quote |$re_word |$re_comment |\S )/ ;
898
- my @tokens = map { $_ =~ / \s *($re_token )\s */g } @_ ;
899
- my $end_of_addr_seen = 0;
900
-
901
- # add a delimiter to simplify treatment for the last mailbox
902
- push @tokens , " ," ;
903
-
904
- my (@addr_list , @phrase , @address , @comment , @buffer ) = ();
905
- foreach my $token (@tokens ) {
906
- if ($token =~ / ^[,;]$ / ) {
907
- # if buffer still contains undeterminated strings
908
- # append it at the end of @address or @phrase
909
- if ($end_of_addr_seen ) {
910
- push @phrase , @buffer ;
911
- } else {
912
- push @address , @buffer ;
913
- }
914
-
915
- my $str_phrase = join ' ' , @phrase ;
916
- my $str_address = join ' ' , @address ;
917
- my $str_comment = join ' ' , @comment ;
918
-
919
- # quote are necessary if phrase contains
920
- # special characters
921
- if ($str_phrase =~ / [][()<>:;@\\ ,.\000 -\037\177 ]/ ) {
922
- $str_phrase =~ s / (^|[^\\ ])"/ $1 / g ;
923
- $str_phrase = qq[ "$str_phrase "] ;
924
- }
925
-
926
- # add "<>" around the address if necessary
927
- if ($str_address ne " " && $str_phrase ne " " ) {
928
- $str_address = qq[ <$str_address >] ;
929
- }
930
-
931
- my $str_mailbox = " $str_phrase $str_address $str_comment " ;
932
- $str_mailbox =~ s / ^\s *|\s *$// g ;
933
- push @addr_list , $str_mailbox if ($str_mailbox );
934
-
935
- @phrase = @address = @comment = @buffer = ();
936
- $end_of_addr_seen = 0;
937
- } elsif ($token =~ / ^\( / ) {
938
- push @comment , $token ;
939
- } elsif ($token eq " <" ) {
940
- push @phrase , (splice @address ), (splice @buffer );
941
- } elsif ($token eq " >" ) {
942
- $end_of_addr_seen = 1;
943
- push @address , (splice @buffer );
944
- } elsif ($token eq " @" && !$end_of_addr_seen ) {
945
- push @address , (splice @buffer ), " @" ;
946
- } else {
947
- push @buffer , $token ;
948
- }
949
- }
950
-
951
- return @addr_list ;
952
- }
953
-
954
883
=item hash_object ( TYPE, FILENAME )
955
884
956
885
Compute the SHA1 object id of the given C<FILENAME > considering it is
0 commit comments