ruby-changes:6482
From: shyouhei <ko1@a...>
Date: Thu, 10 Jul 2008 18:40:02 +0900 (JST)
Subject: [ruby-changes:6482] Ruby:r17998 (ruby_1_8_6): merge revision(s) 17868:
shyouhei 2008-07-10 18:39:50 +0900 (Thu, 10 Jul 2008) New Revision: 17998 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=17998 Log: merge revision(s) 17868: * lib/net/ftp.rb (Net::FTP#sendport): use divmod. [ruby-core:17557] Modified files: branches/ruby_1_8_6/ChangeLog branches/ruby_1_8_6/lib/net/ftp.rb branches/ruby_1_8_6/version.h Index: ruby_1_8_6/ChangeLog =================================================================== --- ruby_1_8_6/ChangeLog (revision 17997) +++ ruby_1_8_6/ChangeLog (revision 17998) @@ -1,3 +1,7 @@ +Thu Jul 10 18:39:17 2008 Nobuyoshi Nakada <nobu@r...> + + * lib/net/ftp.rb (Net::FTP#sendport): use divmod. [ruby-core:17557] + Thu Jul 10 18:35:07 2008 Kazuhiro NISHIYAMA <zn@m...> * ruby.c: Mac OS X needs origargc times of '\0' in Index: ruby_1_8_6/version.h =================================================================== --- ruby_1_8_6/version.h (revision 17997) +++ ruby_1_8_6/version.h (revision 17998) @@ -2,7 +2,7 @@ #define RUBY_RELEASE_DATE "2008-07-10" #define RUBY_VERSION_CODE 186 #define RUBY_RELEASE_CODE 20080710 -#define RUBY_PATCHLEVEL 271 +#define RUBY_PATCHLEVEL 272 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 8 Index: ruby_1_8_6/lib/net/ftp.rb =================================================================== --- ruby_1_8_6/lib/net/ftp.rb (revision 17997) +++ ruby_1_8_6/lib/net/ftp.rb (revision 17998) @@ -278,12 +278,9 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/