From ee827e52a7e953771d8339ab0a351699c775c8e4 Mon Sep 17 00:00:00 2001 From: tenderlove Date: Wed, 8 Feb 2012 18:03:51 +0000 Subject: [PATCH] eliminate `shadowing outer local variable - name` warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/parsers/baseparser.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb index b5b61c34dd..ebffdaa8c7 100644 --- a/lib/rexml/parsers/baseparser.rb +++ b/lib/rexml/parsers/baseparser.rb @@ -373,7 +373,7 @@ module REXML if md[4].size > 0 attrs = md[4].scan( ATTRIBUTE_PATTERN ) raise REXML::ParseException.new( "error parsing attributes: [#{attrs.join ', '}], excess = \"#$'\"", @source) if $' and $'.strip.size > 0 - attrs.each do |name, prefix, local_part, quote, value| + attrs.each do |attr_name, prefix, local_part, quote, value| if prefix == "xmlns" if local_part == "xml" if value != "http://www.w3.org/XML/1998/namespace" @@ -391,12 +391,12 @@ module REXML prefixes << prefix unless prefix == "xml" end - if attributes.has_key?(name) - msg = "Duplicate attribute #{name.inspect}" + if attributes.has_key?(attr_name) + msg = "Duplicate attribute #{attr_name.inspect}" raise REXML::ParseException.new(msg, @source, self) end - attributes[name] = value + attributes[attr_name] = value end end