summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-24 07:11:41 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-24 07:11:41 +0000
commit12985338067c9e8e7744c84c88f0b327835bcafa (patch)
tree606f2a052896ee3989fd9ea5ff2bc68a19fed7a1 /lib
parent5f10f475311fa4e08ff8a91e6329c6853ee3e470 (diff)
merge revision(s) 25311:
* lib/net/ftp.rb (getaddress): rescue exceptions. [ruby-dev:39451] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ftp.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index e07418e83e..369aba893c 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -346,9 +346,9 @@ module Net
private :transfercmd
def getaddress
- thishost = Socket.gethostname
+ thishost = Socket.gethostname rescue ""
if not thishost.index(".")
- thishost = Socket.gethostbyname(thishost)[0]
+ thishost = Socket.gethostbyname(thishost)[0] rescue ""
end
if ENV.has_key?("LOGNAME")
realuser = ENV["LOGNAME"]