Skip to content

Commit

Permalink
Unbust a little IO.
Browse files Browse the repository at this point in the history
Enough so slurp at least works now.
  • Loading branch information
jnthn committed Jun 22, 2013
1 parent 7d6a3e8 commit 2aa4972
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/IO.pm
Expand Up @@ -113,15 +113,15 @@ my class IO::Handle does IO::FileTestable {
}

method eof() {
nqp::p6bool($!PIO.eof);
nqp::p6bool(nqp::eoffh($!PIO));
}

method get() {
unless nqp::defined($!PIO) {
self.open($!path, :chomp($.chomp));
}
return Str if self.eof;
my Str $x = nqp::p6box_s($!PIO.readline);
my Str $x = nqp::p6box_s(nqp::readlinefh($!PIO));
# XXX don't fail() as long as it's fatal
# fail('end of file') if self.eof && $x eq '';
$x.=chomp if $.chomp;
Expand Down Expand Up @@ -220,7 +220,7 @@ my class IO::Handle does IO::FileTestable {
$Buf;
}
else {
my $contents = nqp::p6box_s($!PIO.readall());
my $contents = nqp::p6box_s(nqp::readallfh($!PIO));
self.close();
$contents
}
Expand Down Expand Up @@ -291,7 +291,7 @@ my class IO::Handle does IO::FileTestable {

method encoding($enc?) {
$enc.defined
?? $!PIO.encoding(PARROT_ENCODING($enc))
?? nqp::setencoding($!PIO, PARROT_ENCODING($enc))
!! $!PIO.encoding
}
}
Expand Down

0 comments on commit 2aa4972

Please sign in to comment.