[PATCH 6/7] perl/Git.pm: make command pipe work in slurp-mode on Windows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Gustavo L. de M. Chaves" <gnustavo@xxxxxxxx>

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@xxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]