Actions
Bug #18769
closedStringIO#each hangs up on some input with `chomp: true`
Bug #18769:
StringIO#each hangs up on some input with `chomp: true`
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.0.3
Description
The mentioned StringIO method #each (as well as #readlines and #each_line) may hang up when passed a separator and chomp: true:
The same way behave other two methods:
Updated by jeremyevans0 (Jeremy Evans) about 4 years ago
I've submitted a pull request to fix this: https://github.com/ruby/stringio/pull/30
Updated by jeremyevans (Jeremy Evans) about 4 years ago
- Status changed from Open to Closed
Applied in changeset git|1f82269f4e1bf037e3e5504c6071b905f26fec6f.
[ruby/stringio] Fix each with multiple character string and chomp
Previously, this could result in an infinite loop. Always update
the e pointer in this case, setting w when chomping so the chomped
data is not included in the output.
Fixes [Bug #18769]
Actions