Skip to content

Commit 0a81ab5

Browse files
committed
Fix parameters forwarding to IO#gets in ARGF.gets and Kernel#gets
1 parent 8bec6b3 commit 0a81ab5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/ruby/truffleruby/core/argf.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@ def getc
283283
# The mechanism does track the line numbers,
284284
# and updates $. accordingly.
285285
#
286-
def gets(sep = $/)
286+
def gets(...)
287287
while advance!
288-
line = @stream.gets(sep)
288+
line = @stream.gets(...)
289289

290290
unless line
291291
return nil if @use_stdin_only

src/main/ruby/truffleruby/core/kernel.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ def getc
337337
end
338338
module_function :getc
339339

340-
def gets(*args)
341-
line = ARGF.gets(*args)
340+
def gets(...)
341+
line = ARGF.gets(...)
342342
Primitive.io_last_line_set(Primitive.caller_special_variables, line) if line
343343
line
344344
end

0 commit comments

Comments
 (0)