[前][次][番号順一覧][スレッド一覧]

ruby-changes:6484

From: shyouhei <ko1@a...>
Date: Thu, 10 Jul 2008 18:40:44 +0900 (JST)
Subject: [ruby-changes:6484] Ruby:r18000 (ruby_1_8_7): merge revision(s) 17868:

shyouhei	2008-07-10 18:40:34 +0900 (Thu, 10 Jul 2008)

  New Revision: 18000

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18000

  Log:
    merge revision(s) 17868:
    * lib/net/ftp.rb (Net::FTP#sendport): use divmod.  [ruby-core:17557]

  Modified files:
    branches/ruby_1_8_7/ChangeLog
    branches/ruby_1_8_7/lib/net/ftp.rb
    branches/ruby_1_8_7/version.h

Index: ruby_1_8_7/ChangeLog
===================================================================
--- ruby_1_8_7/ChangeLog	(revision 17999)
+++ ruby_1_8_7/ChangeLog	(revision 18000)
@@ -1,3 +1,7 @@
+Thu Jul 10 18:40:22 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/net/ftp.rb (Net::FTP#sendport): use divmod.  [ruby-core:17557]
+
 Thu Jul 10 18:36:53 2008  Kazuhiro NISHIYAMA  <zn@m...>
 
 	* ruby.c: Mac OS X needs origargc times of '\0' in
Index: ruby_1_8_7/version.h
===================================================================
--- ruby_1_8_7/version.h	(revision 17999)
+++ ruby_1_8_7/version.h	(revision 18000)
@@ -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
Index: ruby_1_8_7/lib/net/ftp.rb
===================================================================
--- ruby_1_8_7/lib/net/ftp.rb	(revision 17999)
+++ ruby_1_8_7/lib/net/ftp.rb	(revision 18000)
@@ -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/

[前][次][番号順一覧][スレッド一覧]