From d68b3a38e956507329496b42c164876e7529d01e Mon Sep 17 00:00:00 2001 From: shugo Date: Mon, 26 Mar 2012 14:39:21 +0000 Subject: * 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 --- ChangeLog | 6 ++++++ lib/net/ftp.rb | 8 ++++---- 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 + + * 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 * 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 /\((?\d+(,\d+){3}),(?\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,(?\d+(,\d+){3}),2,(?\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,(?\d+(,(\d+)){15}),2,(?\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 /\((?[!-~])\k\k(?\d+)\k\)/ =~ resp - return @sock.peeraddr[3], port.to_i + return @sock.peeraddr[3], $~["port"].to_i else raise FTPProtoError, resp end -- cgit v1.2.3