summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-10 09:40:34 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-10 09:40:34 +0000
commit82a63f3daa7472ce6c03bd7b68ea73fde1046754 (patch)
treec2c336843d66b0fb6571b71b76f7f9fceb800232
parent760f8736c02647751f7d497e0fbfe770ff40c432 (diff)
merge revision(s) 17868:
* lib/net/ftp.rb (Net::FTP#sendport): use divmod. [ruby-core:17557] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@18000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--lib/net/ftp.rb7
-rw-r--r--version.h2
3 files changed, 7 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 531581012f..4a8b1f5999 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Jul 10 18:40:22 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/net/ftp.rb (Net::FTP#sendport): use divmod. [ruby-core:17557]
+
Thu Jul 10 18:36:53 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* ruby.c: Mac OS X needs origargc times of '\0' in
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index c3059deea3..ca2c00a790 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -278,12 +278,9 @@ module Net
def sendport(host, port)
af = (@sock.peeraddr)[0]
if af == "AF_INET"
- hbytes = host.split(".")
- pbytes = [port / 256, port % 256]
- bytes = hbytes + pbytes
- cmd = "PORT " + bytes.join(",")
+ cmd = "PORT " + (host.split(".") + port.divmod(256)).join(",")
elsif af == "AF_INET6"
- cmd = "EPRT |2|" + host + "|" + sprintf("%d", port) + "|"
+ cmd = sprintf("EPRT |2|%s|%d|", host, port)
else
raise FTPProtoError, host
end
diff --git a/version.h b/version.h
index 981b6e1bc1..cea836bb5f 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-07-10"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080710
-#define RUBY_PATCHLEVEL 52
+#define RUBY_PATCHLEVEL 53
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8