Skip to content

Commit 330e0b2

Browse files
committed
Add limit argument to readline as well
The previous commit added a limit argument to #gets as defined by Ruby's IO class. This does the same for readline since it also accepts a limit argument in the IO class. Fortunately we simply forward these params to gets.
1 parent 1c763ef commit 330e0b2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/net/sftp/operations/file.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ def gets(sep_or_limit=$/, limit=Float::INFINITY)
115115

116116
# Same as #gets, but raises EOFError if EOF is encountered before any
117117
# data could be read.
118-
def readline(sep_string=$/)
119-
line = gets(sep_string)
118+
def readline(sep_or_limit=$/, limit=Float::INFINITY)
119+
line = gets(sep_or_limit, limit)
120120
raise EOFError if line.nil?
121121
return line
122122
end

0 commit comments

Comments
 (0)