diff options
author | Jeremy Evans <code@jeremyevans.net> | 2022-05-26 12:22:42 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2022-07-21 12:55:24 -0700 |
commit | 7223c0da152114c84e1c4261a282faaea21646fb (patch) | |
tree | 92ec924c4c538126b2552e42190dd2d2844d0cd0 /io.c | |
parent | 3a5ea7c688b5c029ee8f69d84f49bc10b817714e (diff) |
Do not chomp trailing line separator IO#each with nil separator and chomp
nil separator means no sepator, so chomp should not remove a line
separator.
Partially Fixes [Bug #18770]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6164
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 1 |
1 files changed, 0 insertions, 1 deletions
@@ -3875,7 +3875,6 @@ rb_io_getline_0(VALUE rs, long limit, int chomp, rb_io_t *fptr) if (NIL_P(rs) && limit < 0) { str = read_all(fptr, 0, Qnil); if (RSTRING_LEN(str) == 0) return Qnil; - if (chomp) rb_str_chomp_string(str, rb_default_rs); } else if (limit == 0) { return rb_enc_str_new(0, 0, io_read_encoding(fptr)); |