Skip to content

Commit

Permalink
Fix git-remote for ActiveState Perl
Browse files Browse the repository at this point in the history
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: Alex Riesen <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
raalkml authored and gitster committed Aug 22, 2007
1 parent 687157c commit 2f5b398
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion perl/Git.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2f5b398

Please sign in to comment.