summaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2007-08-22 18:13:07 +0200
committerJunio C Hamano <gitster@pobox.com>2007-08-22 15:28:58 -0700
commit2f5b3980617bd618ebb4314cadaff4e71ce2a390 (patch)
treef6832f0542b21f6602ec35dd75dcd4190bdcaf09 /perl
parent687157c736d7a1aac152866cbe20030aaa25513f (diff)
downloadgit-2f5b3980617bd618ebb4314cadaff4e71ce2a390.tar.gz
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>
Diffstat (limited to 'perl')
-rw-r--r--perl/Git.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index 8fd3611753..3f4080cbf8 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -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 {