aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-26 14:39:21 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-03-26 14:39:21 +0000
commitd68b3a38e956507329496b42c164876e7529d01e (patch)
treec41846d03c7ec223ca06fbda50bc7e21388bac8f
parent422c8baeb9639cc51a9f7d458c521f9bd4d98969 (diff)
downloadruby-d68b3a38e956507329496b42c164876e7529d01e.tar.gz
* lib/net/ftp.rb (parse227, parse228, parse229): don't use local
variables defined by named capture for other Ruby implementations such as Rubinius. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/net/ftp.rb8
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index f68193c483..2ef8d54d82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Mar 26 23:34:40 2012 Shugo Maeda <shugo@ruby-lang.org>
+
+ * lib/net/ftp.rb (parse227, parse228, parse229): don't use local
+ variables defined by named capture for other Ruby implementations
+ such as Rubinius.
+
Mon Mar 26 23:19:03 2012 Shugo Maeda <shugo@ruby-lang.org>
* lib/net/ftp.rb (parse_pasv_port): refactored.
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index a92a792b35..46260dfc8e 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -924,7 +924,7 @@ module Net
raise FTPReplyError, resp
end
if /\((?<host>\d+(,\d+){3}),(?<port>\d+,\d+)\)/ =~ resp
- return parse_pasv_ipv4_host(host), parse_pasv_port(port)
+ return parse_pasv_ipv4_host($~["host"]), parse_pasv_port($~["port"])
else
raise FTPProtoError, resp
end
@@ -940,9 +940,9 @@ module Net
raise FTPReplyError, resp
end
if /\(4,4,(?<host>\d+(,\d+){3}),2,(?<port>\d+,\d+)\)/ =~ resp
- return parse_pasv_ipv4_host(host), parse_pasv_port(port)
+ return parse_pasv_ipv4_host($~["host"]), parse_pasv_port($~["port"])
elsif /\(6,16,(?<host>\d+(,(\d+)){15}),2,(?<port>\d+,\d+)\)/ =~ resp
- return parse_pasv_ipv6_host(host), parse_pasv_port(port)
+ return parse_pasv_ipv6_host($~["host"]), parse_pasv_port($~["port"])
else
raise FTPProtoError, resp
end
@@ -978,7 +978,7 @@ module Net
raise FTPReplyError, resp
end
if /\((?<d>[!-~])\k<d>\k<d>(?<port>\d+)\k<d>\)/ =~ resp
- return @sock.peeraddr[3], port.to_i
+ return @sock.peeraddr[3], $~["port"].to_i
else
raise FTPProtoError, resp
end