Skip to content

Commit

Permalink
add back corrected comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nhz2 committed Apr 14, 2024
1 parent 97d57ad commit bb37393
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/iobuffer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ function seek(io::GenericIOBuffer, n::Int)
ismarked(io) || throw(ArgumentError("seek failed, IOBuffer is not seekable and is not marked"))
n == io.mark || throw(ArgumentError("seek failed, IOBuffer is not seekable and n != mark"))
end
# TODO: REPL.jl relies on the fact that this does not throw (by seeking past the beginning or end
# of an GenericIOBuffer), so that would need to be fixed in order to throw an error here
#(n < 0 || n > io.size - io.offset) && throw(ArgumentError("Attempted to seek outside IOBuffer boundaries."))
#io.ptr = n + io.offset + 1
io.ptr = clamp(n, 0, io.size - io.offset) + io.offset + 1
return io
end
Expand Down

0 comments on commit bb37393

Please sign in to comment.