Merge remote branch 'origin/bufferedReaderFix'

This commit is contained in:
Joel Dice 2011-09-01 09:35:28 -06:00
commit 4cc5b5d902

View File

@ -42,7 +42,15 @@ public class BufferedReader extends Reader {
}
for (int i = position; i < limit; ++i) {
if (buffer[i] == '\n') {
if(buffer[i] == '\r') {
sb.append(buffer, position, i - position);
position = i + 1;
if(i+1 < limit && buffer[i+1] == '\n') {
position = i + 1;
return sb.toString();
}
return sb.toString();
} else if (buffer[i] == '\n') {
sb.append(buffer, position, i - position);
position = i + 1;
return sb.toString();