diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-26 14:39:21 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-26 14:39:21 +0000 |
commit | d68b3a38e956507329496b42c164876e7529d01e (patch) | |
tree | c41846d03c7ec223ca06fbda50bc7e21388bac8f /lib/net/ftp.rb | |
parent | 422c8baeb9639cc51a9f7d458c521f9bd4d98969 (diff) | |
download | ruby-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
Diffstat (limited to 'lib/net/ftp.rb')
-rw-r--r-- | lib/net/ftp.rb | 8 |
1 files changed, 4 insertions, 4 deletions
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 |