From dae834c0e548c4f048cfd158c1994879eb643bbd Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 28 Dec 2015 00:04:03 +0000 Subject: git: local $/ for getline We may be setting $/ elsewhere, so do not let our callers inadvertantly break us. --- lib/PublicInbox/Git.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/PublicInbox/Git.pm') diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index aec2db0b..a7e50925 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -40,6 +40,7 @@ sub cat_file_begin { $self->{out}->print($obj, "\n") or fail($self, "write error: $!"); my $in = $self->{in}; + local $/ = "\n"; my $head = $in->getline; $head =~ / missing$/ and return undef; $head =~ /^([0-9a-f]{40}) (\S+) (\d+)$/ or @@ -102,6 +103,7 @@ sub check { my ($self, $obj) = @_; $self->_bidi_pipe(qw(--batch-check in_c out_c pid_c)); $self->{out_c}->print($obj, "\n") or fail($self, "write error: $!"); + local $/ = "\n"; chomp(my $line = $self->{in_c}->getline); my ($hex, $type, $size) = split(' ', $line); return if $type eq 'missing'; -- cgit v1.2.3-24-ge0c7