summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-07-21 08:29:50 -0700
committerJeremy Evans <code@jeremyevans.net>2022-07-21 08:29:50 -0700
commit203f179ce7d1bde0befb8d12148aa392ad45ac56 (patch)
treeb36cdf25d9eadf4547df3f6ab5b8f38ff8731595 /io.c
parent12ac8971a394118a57640299f654e46e763093fa (diff)
downloadruby-203f179ce7d1bde0befb8d12148aa392ad45ac56.tar.gz
Revert "Do not chomp trailing line separator IO#each with nil separator and chomp"
This reverts commit 04f86ad0b5d2fe4711ff300d855228a6aed55f33. This is causing CI issues, reverting for now.
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index 13cde15360..650ea5e377 100644
--- a/io.c
+++ b/io.c
@@ -3875,6 +3875,7 @@ 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));