summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--lib/net/ftp.rb4
-rw-r--r--version.h2
3 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ec9e67dff..77371c3ecf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Nov 24 16:09:41 2009 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (getaddress): rescue exceptions. [ruby-dev:39451]
+
Tue Nov 24 15:51:07 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* ext/curses/curses.c: Many functions of module Curses could cause a
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"]
diff --git a/version.h b/version.h
index cc58778981..7680b8cbc2 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2009-11-24"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20091124
-#define RUBY_PATCHLEVEL 217
+#define RUBY_PATCHLEVEL 218
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8