Skip to content

Commit a247cfc

Browse files
committed
make it perform more like original in some situations.
1 parent f1730e8 commit a247cfc

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/main/java/org/apache/commons/io/IOUtils.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ public static boolean contentEqualsIgnoreEOL(final Reader input1, final Reader i
896896
* Because "a" and "a\n" is thought contentEqualsIgnoreEOL,
897897
* but "\n" and "\n\n" is thought not contentEqualsIgnoreEOL.
898898
*/
899-
boolean justNewLine = false;
899+
boolean justNewLine = true;
900900

901901
int currentChar1;
902902
int currentChar2;
@@ -923,9 +923,7 @@ public static boolean contentEqualsIgnoreEOL(final Reader input1, final Reader i
923923
if (currentChar1 != currentChar2) {
924924
return false;
925925
}
926-
if (currentChar1 == '\n') {
927-
justNewLine = true;
928-
}
926+
justNewLine = currentChar1 == '\n';
929927
bufferedInput1.eat();
930928
bufferedInput2.eat();
931929
}

0 commit comments

Comments
 (0)