mirror of
https://github.com/corda/corda.git
synced 2025-01-09 06:23:04 +00:00
Fixed behavior of readLine accepting *\n\n as a line, not two
This commit is contained in:
parent
97e03b9f28
commit
fb3a23f02d
@ -42,13 +42,18 @@ public class BufferedReader extends Reader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = position; i < limit; ++i) {
|
for (int i = position; i < limit; ++i) {
|
||||||
if (buffer[i] == '\n' || buffer[i] == '\r') {
|
if(buffer[i] == '\r') {
|
||||||
sb.append(buffer, position, i - position);
|
sb.append(buffer, position, i - position);
|
||||||
position = i + 1;
|
position = i + 1;
|
||||||
if(i+1 < limit && buffer[i+1] == '\n') {
|
if(i+1 < limit && buffer[i+1] == '\n') {
|
||||||
position = i + 1;
|
position = i + 1;
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
} else if (buffer[i] == '\n') {
|
||||||
|
sb.append(buffer, position, i - position);
|
||||||
|
position = i + 1;
|
||||||
|
return sb.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sb.append(buffer, position, limit-position);
|
sb.append(buffer, position, limit-position);
|
||||||
|
Loading…
Reference in New Issue
Block a user