Browse Source

Use exact matches instead of substring matches in the parser so that

comments containing dashes or equals signs are less likely to throw
off the parser.

I have no idea how portable the exact number of characters is, that's
why I won't merge it into the 1.6 branch.

PR: 8085
Suggested by:	Peter Leschev


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275471 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 21 years ago
parent
commit
36e39c68ce
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java

+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java View File

@@ -148,7 +148,7 @@ class ChangeLogParser {
*/
private void processComment(final String line) {
final String lineSeparator = System.getProperty("line.separator");
if (line.startsWith("======")) {
if (line.equals("=============================================================================")) {
//We have ended changelog for that particular file
//so we can save it
final int end
@@ -156,7 +156,7 @@ class ChangeLogParser {
m_comment = m_comment.substring(0, end);
saveEntry();
m_status = GET_FILE;
} else if (line.startsWith("----------------------------")) {
} else if (line.equals("----------------------------")) {
final int end
= m_comment.length() - lineSeparator.length(); //was -1
m_comment = m_comment.substring(0, end);


Loading…
Cancel
Save