ruby-changes:50879
From: kou <ko1@a...>
Date: Wed, 4 Apr 2018 15:36:13 +0900 (JST)
Subject: [ruby-changes:50879] kou:r63086 (trunk): rexml: Fix a XPath bug of function()/path
kou 2018-04-04 15:36:06 +0900 (Wed, 04 Apr 2018) New Revision: 63086 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63086 Log: rexml: Fix a XPath bug of function()/path [Bug #14600] * lib/rexml/functions.rb: Fix a bug that "function()/path" always returns nothing. Modified files: trunk/lib/rexml/parsers/xpathparser.rb Index: lib/rexml/parsers/xpathparser.rb =================================================================== --- lib/rexml/parsers/xpathparser.rb (revision 63085) +++ lib/rexml/parsers/xpathparser.rb (revision 63086) @@ -515,7 +515,9 @@ module REXML https://github.com/ruby/ruby/blob/trunk/lib/rexml/parsers/xpathparser.rb#L515 rest = FilterExpr( path, n ) if rest != path if rest and rest[0] == ?/ - return RelativeLocationPath(rest, n) + rest = RelativeLocationPath(rest, n) + parsed.concat(n) + return rest end end rest = LocationPath(rest, n) if rest =~ /\A[\/\.\@\[\w*]/ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/