提交 2f5b3980 编写于 作者: A Alex Riesen 提交者: Junio C Hamano

Fix git-remote for ActiveState Perl

For reason unknown a package in ActiveState Perl 5.8.7 must implement
READLINE method differently for scalar and array context. The code
tested to work for more sane and recent version of perl (5.8.8 shipped
with Ubuntu), so maybe it was always a requirement.
Signed-off-by: NAlex Riesen <raa.lkml@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 687157c7
......@@ -860,7 +860,13 @@ sub READLINE {
if ($self->{i} >= scalar @{$self->{data}}) {
return undef;
}
return $self->{'data'}->[ $self->{i}++ ];
my $i = $self->{i};
if (wantarray) {
$self->{i} = $#{$self->{'data'}} + 1;
return splice(@{$self->{'data'}}, $i);
}
$self->{i} = $i + 1;
return $self->{'data'}->[ $i ];
}
sub CLOSE {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册