git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271726 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -146,18 +146,19 @@ public final class TailFilter | |||||
| } | } | ||||
| } | } | ||||
| if (ch == '\n') { | |||||
| if (ch == '\n' || ch == -1) { | |||||
| ++linesRead; | ++linesRead; | ||||
| if (linesRead == lines) { | if (linesRead == lines) { | ||||
| int i = 0; | int i = 0; | ||||
| for (i = returnedCharPos + 1; | for (i = returnedCharPos + 1; | ||||
| buffer[i] != 0 && buffer[i] != '\n'; i++) { | |||||
| buffer[i] != 0 && buffer[i] != '\n'; i++) { | |||||
| } | } | ||||
| returnedCharPos = i; | returnedCharPos = i; | ||||
| --linesRead; | --linesRead; | ||||
| } | } | ||||
| } else if (ch == -1) { | |||||
| } | |||||
| if (ch == -1) { | |||||
| break; | break; | ||||
| } | } | ||||