Skip to content

Commit

Permalink
fix epubcheck DefaultReportImpl to avoid duplicate epubName entries i…
Browse files Browse the repository at this point in the history
…n path // fixes #729
  • Loading branch information
tofi86 committed Dec 24, 2016
1 parent 9f0e7d1 commit 9321355
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ public void message(Message message, EPUBLocation location, Object... args)

String formatMessage(Message message, EPUBLocation location, Object... args)
{
String fileName = (location.getPath() == null ? "" : "/" + location.getPath());
fileName = PathUtil.removeWorkingDirectory(fileName);
String epubFileName = PathUtil.removeWorkingDirectory(this.getEpubFileName());
String fileName = PathUtil.removeWorkingDirectory(location.getPath());
// remove duplicate epub name from path and empty fileName variable
fileName = epubFileName.endsWith(fileName) ? "" : "/" + fileName;
return String.format("%1$s(%2$s): %3$s%4$s(%5$s,%6$s): %7$s",
message.getSeverity(),
message.getID(),
PathUtil.removeWorkingDirectory(this.getEpubFileName()),
epubFileName,
fileName,
location.getLine(),
location.getColumn(),
Expand Down

0 comments on commit 9321355

Please sign in to comment.