Skip to content

Commit

Permalink
Improve countlines docstring (#39677)
Browse files Browse the repository at this point in the history
The last result was 0, but that's just because the IO has already moved
the stream pointer to EOF, not because of anything to do with the `eol`
keyword argument.
  • Loading branch information
cmcaine committed Feb 15, 2021
1 parent a92d7de commit 0d67f0d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1178,8 +1178,13 @@ julia> io = IOBuffer("JuliaLang is a GitHub organization.");
julia> countlines(io)
1
julia> eof(io) # counting lines moves the file pointer
true
julia> io = IOBuffer("JuliaLang is a GitHub organization.");
julia> countlines(io, eol = '.')
0
1
```
"""
function countlines(io::IO; eol::AbstractChar='\n')
Expand Down

0 comments on commit 0d67f0d

Please sign in to comment.