[PATCH 6/7] perl/Git.pm: make command pipe work in slurp-mode on Windows
- From
Gustavo L. de M. Chaves <gnustavo@cpan.org>
- Date
- Jan 30, 2013, 17:23 UTC
- Message-ID
- <1359566583-19654-7-git-send-email-gnustavo@cpan.org>
- In-Reply-To
- <1359566583-19654-1-git-send-email-gnustavo@cpan.org>
From: "Gustavo L. de M. Chaves" <gnustavo@cpan.org>
Git::activestate_pipe::READLINE implementation wasn't working when the pipe was read in slurp-mode (i.e., with $/ undefined).
Now, when in slurp-mode it correctly returns the remaining lines joined together.
Signed-off-by: Gustavo L. de M. Chaves <gnustavo@cpan.org> --- perl/Git.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/perl/Git.pm b/perl/Git.pm index 2d88b89..fdef024 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -1410,8 +1410,10 @@ sub READLINE { return unless @{$self->{data}}; if (wantarray) { return splice @{$self->{data}}; - } else { + } elsif (defined $/) { return shift @{$self->{data}}; + } else { + return join('', splice @{$self->{data}}); } }
-- 1.7.12.464.g83379df.dirty