summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/io.c b/io.c
index 363e839cb7..54c3dee767 100644
--- a/io.c
+++ b/io.c
@@ -1347,10 +1347,8 @@ rb_io_gets_m(argc, argv, io)
}
GetOpenFile(io, fptr);
str = rb_io_getline(rs, fptr);
+ rb_lastline_set(str);
- if (!NIL_P(str)) {
- rb_lastline_set(str);
- }
return str;
}