From 1d6ca665f5df248c6c838129c62fe67e040c209c Mon Sep 17 00:00:00 2001 From: kou Date: Wed, 4 Apr 2018 06:36:06 +0000 Subject: [PATCH] rexml: Fix a XPath bug of function()/path [Bug #14600] * lib/rexml/functions.rb: Fix a bug that "function()/path" always returns nothing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/parsers/xpathparser.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rexml/parsers/xpathparser.rb b/lib/rexml/parsers/xpathparser.rb index 32b70bb798..5e0e429240 100644 --- a/lib/rexml/parsers/xpathparser.rb +++ b/lib/rexml/parsers/xpathparser.rb @@ -515,7 +515,9 @@ module REXML 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*]/