From 58cd6f1a77611b323bbabedb4da2b49e31a120a1 Mon Sep 17 00:00:00 2001 From: Tobias Leich Date: Sun, 5 Oct 2014 13:07:02 +0200 Subject: [PATCH] nqp::eoffh on parrot does not detect EOF early This re-introduced code that checks if we are at EOF. Also bump nqp for nqp::eoffh fix. --- src/core/IO/Handle.pm | 14 ++++++++++++++ tools/build/NQP_REVISION | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/core/IO/Handle.pm b/src/core/IO/Handle.pm index 90e5ee2d983..0018f36a334 100644 --- a/src/core/IO/Handle.pm +++ b/src/core/IO/Handle.pm @@ -299,7 +299,14 @@ my class IO::Handle does IO::FileTestable { if $.chomp { gather { until nqp::eoffh($!PIO) { +#?if parrot + my Mu $line := nqp::readlinefh($!PIO); + last unless $line.DEFINITE; + take nqp::p6box_s($line).chomp; +#?endif +#?if !parrot take nqp::p6box_s(nqp::readlinefh($!PIO)).chomp; +#?endif $!ins = $!ins + 1; } self.close if $close; @@ -308,7 +315,14 @@ my class IO::Handle does IO::FileTestable { else { gather { until nqp::eoffh($!PIO) { +#?if parrot + my Mu $line := nqp::readlinefh($!PIO); + last unless $line.DEFINITE; + take nqp::p6box_s($line); +#?endif +#?if !parrot take nqp::p6box_s(nqp::readlinefh($!PIO)); +#?endif $!ins = $!ins + 1; } self.close if $close; diff --git a/tools/build/NQP_REVISION b/tools/build/NQP_REVISION index 7cffa761847..8dff146202b 100644 --- a/tools/build/NQP_REVISION +++ b/tools/build/NQP_REVISION @@ -1 +1 @@ -2014.09-17-g5107793 +2014.09-20-gb79b20c