Skip to content

Commit

Permalink
xpah abbreviate: add missing "/" to :descendant_or_self/:self/:parent
Browse files Browse the repository at this point in the history
GitHub: fix GH-97

Reported by pulver. Thanks!!!
  • Loading branch information
kou committed May 27, 2023
1 parent e08c52f commit 399e83d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rexml/parsers/xpathparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def abbreviate( path )
when :child
string << "/" if string.size > 0
when :descendant_or_self
string << "/"
string << "//"
when :self
string << "."
string << "/"
when :parent
string << ".."
string << "/.."
when :any
string << "*"
when :text
Expand Down

1 comment on commit 399e83d

@pulver
Copy link
Contributor

@pulver pulver commented on 399e83d May 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes problems for relative paths like ../a which gets incorrectly abbreviated to /../a due to this change.

Please consider PR #98 as a resolution.

Please sign in to comment.