Skip to content

Commit

Permalink
Fix function
Browse files Browse the repository at this point in the history
  • Loading branch information
nck-mlcnv committed Aug 19, 2024
1 parent 705a56a commit 42d98b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/aksw/iguana/cc/utils/files/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ public static String getLineEnding(Path filepath) throws IOException {
if (c == '\n')
return "\n";
else if (c == '\r') {
if ((char) br.read() == '\n')
if (!buffer.hasRemaining() && br.read(buffer) == -1)
return "\r";
if (buffer.hasRemaining() && buffer.get() == '\n')
return "\r\n";
return "\r";
}
Expand Down

0 comments on commit 42d98b6

Please sign in to comment.