From 80cb3351ddcfabf7ba470a098f692c378456854d Mon Sep 17 00:00:00 2001 From: kou Date: Sat, 11 Jun 2011 07:05:42 +0000 Subject: * lib/rexml/parsers/xpathparser.rb (REXML::Parsers::XPathParser#parse), test/rexml/test_elements.rb (ElementsTester::test_each_with_frozen_condition): don't modify original XPath. fixes #4164 Reported by Pavel Shved. Thanks!!! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/parsers/xpathparser.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/rexml/parsers/xpathparser.rb') diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb index 780e312671..e643d11511 100644 --- a/lib/rexml/parsers/xpathparser.rb +++ b/lib/rexml/parsers/xpathparser.rb @@ -17,8 +17,9 @@ module REXML end def parse path + path = path.dup path.gsub!(/([\(\[])\s+/, '\1') # Strip ignorable spaces - path.gsub!( /\s+([\]\)])/, '\1' ) + path.gsub!( /\s+([\]\)])/, '\1') parsed = [] path = OrExpr(path, parsed) parsed -- cgit v1.2.3