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

ruby-changes:28178

From: usa <ko1@a...>
Date: Thu, 11 Apr 2013 11:29:07 +0900 (JST)
Subject: [ruby-changes:28178] usa:r40230 (ruby_1_9_3): merge revision(s) 39299,39300: [Backport #7477]

usa	2013-04-11 11:28:53 +0900 (Thu, 11 Apr 2013)

  New Revision: 40230

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

  Log:
    merge revision(s) 39299,39300: [Backport #7477]
    
    * lib/ipaddr.rb (IPAddr#in6_addr): Fix the parser so that it can
      recognize IPv6 addresses with only one edge 16-bit piece
      compressed, like [::2:3:4:5:6:7:8] or [1:2:3:4:5:6:7::].
      [Bug #7477]
    
    * lib/ipaddr.rb (IPAddr#in6_addr): Fix a typo with the closing
      parenthesis.

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/lib/ipaddr.rb
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 40229)
+++ ruby_1_9_3/ChangeLog	(revision 40230)
@@ -1,3 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Thu Apr 11 11:24:42 2013  Akinori MUSHA  <knu@i...>
+
+	* lib/ipaddr.rb (IPAddr#in6_addr): Fix a typo with the closing
+	  parenthesis.
+
+Thu Apr 11 11:24:42 2013  Akinori MUSHA  <knu@i...>
+
+	* lib/ipaddr.rb (IPAddr#in6_addr): Fix the parser so that it can
+	  recognize IPv6 addresses with only one edge 16-bit piece
+	  compressed, like [::2:3:4:5:6:7:8] or [1:2:3:4:5:6:7::].
+	  [Bug #7477]
+
 Thu Apr 11 11:22:32 2013  Naohisa Goto  <ngoto@g...>
 
 	* string.c (rb_str_concat): set array element after definition
Index: ruby_1_9_3/lib/ipaddr.rb
===================================================================
--- ruby_1_9_3/lib/ipaddr.rb	(revision 40229)
+++ ruby_1_9_3/lib/ipaddr.rb	(revision 40230)
@@ -534,7 +534,8 @@ class IPAddr https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/ipaddr.rb#L534
         left = $1
         right = $3 + '0:0'
       else
-        left.count(':') <= 7 or raise ArgumentError, "invalid address"
+        left.count(':') <= ($1.empty? || $2.empty? ? 8 : 7) or
+          raise InvalidAddressError, "invalid address"
         left = $1
         right = $2
         addr = 0
@@ -656,6 +657,8 @@ class TC_IPAddr < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/ipaddr.rb#L657
       ["0:0:0:1::"],
       ["2001:200:300::/48"],
       ["2001:200:300::192.168.1.2/48"],
+      ["1:2:3:4:5:6:7::"],
+      ["::2:3:4:5:6:7:8"],
     ].each { |args|
       assert_nothing_raised {
         IPAddr.new(*args)
@@ -712,6 +715,8 @@ class TC_IPAddr < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/lib/ipaddr.rb#L715
     assert_equal("2001:200:300::", IPAddr.new("2001:200:300::/48").to_s)
 
     assert_equal("2001:200:300::", IPAddr.new("[2001:200:300::]/48").to_s)
+    assert_equal("1:2:3:4:5:6:7:0", IPAddr.new("1:2:3:4:5:6:7::").to_s)
+    assert_equal("0:2:3:4:5:6:7:8", IPAddr.new("::2:3:4:5:6:7:8").to_s)
 
     [
       ["192.168.0.256"],
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 40229)
+++ ruby_1_9_3/version.h	(revision 40230)
@@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 414
+#define RUBY_PATCHLEVEL 415
 
 #define RUBY_RELEASE_DATE "2013-04-11"
 #define RUBY_RELEASE_YEAR 2013

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39299-39300


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

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