diff --git a/src/main/java/org/apache/commons/io/IOUtils.java b/src/main/java/org/apache/commons/io/IOUtils.java index 61376a45c1a..b6ad7820bcb 100644 --- a/src/main/java/org/apache/commons/io/IOUtils.java +++ b/src/main/java/org/apache/commons/io/IOUtils.java @@ -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; @@ -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(); }