Skip to content

Commit

Permalink
Fix start position of PI and comment for all reported errors (#124)
Browse files Browse the repository at this point in the history
This closes #124
  • Loading branch information
joehni authored and michael-o committed May 17, 2022
1 parent 89b8ef5 commit 2c6fe7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java
Expand Up @@ -2988,7 +2988,7 @@ private void parseComment()
posStart = pos;

final int curLine = lineNumber;
final int curColumn = columnNumber;
final int curColumn = columnNumber - 4;
try
{
final boolean normalizeIgnorableWS = tokenize && !roundtripSupported;
Expand Down Expand Up @@ -3109,7 +3109,7 @@ private boolean parsePI()
if ( tokenize )
posStart = pos;
final int curLine = lineNumber;
final int curColumn = columnNumber;
final int curColumn = columnNumber - 2;
int piTargetStart = pos;
int piTargetEnd = -1;
final boolean normalizeIgnorableWS = tokenize && !roundtripSupported;
Expand Down Expand Up @@ -3156,7 +3156,7 @@ else if ( !seenInnerTag )
{
// seenPITarget && !seenQ
throw new XmlPullParserException( "processing instruction started on line " + curLine
+ " and column " + (curColumn -2) + " was not closed", this, null );
+ " and column " + curColumn + " was not closed", this, null );
}
}
else if ( ch == '<' )
Expand Down

0 comments on commit 2c6fe7e

Please sign in to comment.