summaryrefslogtreecommitdiff
path: root/lib/net/ftp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net/ftp.rb')
-rw-r--r--lib/net/ftp.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index eabe6f5f08..6b452b8a75 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -1105,13 +1105,16 @@ module Net
end
def gets
- return readuntil("\n")
- rescue EOFError
- return nil
+ line = readuntil("\n", true)
+ return line.empty? ? nil : line
end
def readline
- return readuntil("\n")
+ line = gets
+ if line.nil?
+ raise EOFError, "end of file reached"
+ end
+ return line
end
end
# :startdoc: