ruby/ext/stringio
Jean byroot Boussier f087f2c74c [ruby/stringio] StringIO#pread: handle 0 length like IO#pread
(https://github.com/ruby/stringio/pull/67)

Fix: https://github.com/ruby/stringio/issues/66

If length is 0, IO#pread don't even try to read the IO, it simply return
the buffer untouched if there is one or a new empty buffer otherwise.

It also doesn't validate the offset when length is 0.

cc @jdelStrother @kou

37e9279337

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-10-05 07:44:08 +00:00
..
depend Update the depend files 2023-02-28 09:09:00 -08:00
extconf.rb [ruby/stringio] Drop support for ruby 2.6 or earlier 2023-05-08 07:21:21 +00:00
README.md
stringio.c [ruby/stringio] StringIO#pread: handle 0 length like IO#pread 2023-10-05 07:44:08 +00:00
stringio.gemspec [ruby/stringio] Drop support for ruby 2.6 or earlier 2023-05-08 07:21:21 +00:00

StringIO

Pseudo IO class from/to String.

This library is based on MoonWolf version written in Ruby. Thanks a lot.

Differences to IO

  • fileno raises NotImplementedError.
  • encoding conversion is not implemented, and ignored silently.