diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-26 14:39:16 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-26 14:39:16 +0000 |
commit | 422c8baeb9639cc51a9f7d458c521f9bd4d98969 (patch) | |
tree | 56d02bdece9016c24e0368c848628bfaa7375aa5 /lib/net/ftp.rb | |
parent | cae1d532f5969d794179f398a6c867d5f402c21c (diff) | |
download | ruby-422c8baeb9639cc51a9f7d458c521f9bd4d98969.tar.gz |
* lib/net/ftp.rb (parse_pasv_port): refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/ftp.rb')
-rw-r--r-- | lib/net/ftp.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 4fc7fabee3..a92a792b35 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -963,8 +963,9 @@ module Net private :parse_pasv_ipv6_host def parse_pasv_port(s) - high, low = s.split(/,/).map(&:to_i) - return (high << 8) + low + return s.split(/,/).map(&:to_i).inject { |x, y| + (x << 8) + y + } end private :parse_pasv_port |