Samuel GROOT <samuel.gr...@grenoble-inp.org> wrote:
> +++ b/perl/Git.pm

> +sub parse_email {
> +     my %mail = ();
> +     my $fh = shift;
> +     my $last_header;
> +
> +     # Unfold and parse multiline header fields

When you libify, I suggest you localize $/ since $/
may be set to something other than "\n" by a caller
and change the behavior of <$fh> and $fh->getline.

        local $/ = "\n";

> +     while (<$fh>) {
> +             last if /^\s*$/;
> +             s/\r\n|\n|\r//;

And, as Eric Sunshine stated:

                s/\r?\n$//;

Explicitly localizing $/ means you wouldn't have to worry about
multiple \n showing up in the line, either.
And chomp/chop wouldn't work, here.

Otherwise I like the move to Git.pm, thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to