@matheusbsbs / matheus-bagliano / commits / 2f5b398061
Fork 0

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: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Alex Riesen committed Aug 22, 2007 at 18:13 UTC 2f5b3980617bd618ebb4314cadaff4e71ce2a390
1 file changed +7 -1
perl/Git.pm
+7 -1
@@ -860,7 +860,13 @@ sub READLINE {
860 if ($self->{i} >= scalar @{$self->{data}}) {
861 return undef;
862 }
863 - return $self->{'data'}->[ $self->{i}++ ];
863 + my $i = $self->{i};
864 + if (wantarray) {
865 + $self->{i} = $#{$self->{'data'}} + 1;
866 + return splice(@{$self->{'data'}}, $i);
867 + }
868 + $self->{i} = $i + 1;
869 + return $self->{'data'}->[ $i ];
870 }
871
872 sub CLOSE {