Skip to content

Commit

Permalink
make it perform more like original in some situations.
Browse files Browse the repository at this point in the history
  • Loading branch information
XenoAmess committed Aug 5, 2020
1 parent f1730e8 commit a247cfc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/org/apache/commons/io/IOUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ public static boolean contentEqualsIgnoreEOL(final Reader input1, final Reader i
* Because "a" and "a\n" is thought contentEqualsIgnoreEOL,
* but "\n" and "\n\n" is thought not contentEqualsIgnoreEOL.
*/
boolean justNewLine = false;
boolean justNewLine = true;

int currentChar1;
int currentChar2;
Expand All @@ -923,9 +923,7 @@ public static boolean contentEqualsIgnoreEOL(final Reader input1, final Reader i
if (currentChar1 != currentChar2) {
return false;
}
if (currentChar1 == '\n') {
justNewLine = true;
}
justNewLine = currentChar1 == '\n';
bufferedInput1.eat();
bufferedInput2.eat();
}
Expand Down

0 comments on commit a247cfc

Please sign in to comment.