Skip to content

Commit

Permalink
Have tell do a flush first.
Browse files Browse the repository at this point in the history
Otherwise it can report the position incorrectly if we have got
buffering enabled.
  • Loading branch information
jnthn committed Sep 4, 2017
1 parent 75c9870 commit 138b6ce
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/IO/Handle.pm
Expand Up @@ -531,6 +531,7 @@ my class IO::Handle {
}

method tell(IO::Handle:D: --> Int:D) {
nqp::flushfh($!PIO);
nqp::tellfh($!PIO) - ($!decoder ?? $!decoder.bytes-available !! 0)
}

Expand Down

0 comments on commit 138b6ce

Please sign in to comment.