Merge branch 'master' of ssh://oss.readytalk.com/var/local/git/avian

This commit is contained in:
Eric Scharff 2008-07-15 09:38:02 -06:00
commit 0df3beef06

View File

@ -38,16 +38,18 @@ public class BufferedReader extends Reader {
} }
if (position >= limit) { if (position >= limit) {
return sb.toString(); return sb.length() == 0 ? null : sb.toString();
} }
for (int i = position; i < limit; ++i) { for (int i = position; i < limit; ++i) {
if (buffer[i] == '\n') { if (buffer[i] == '\n') {
sb.append(buffer, position, i); sb.append(buffer, position, i - position);
position = i + 1; position = i + 1;
return sb.toString(); return sb.toString();
} }
} }
sb.append(buffer, position, limit-position);
position = limit;
} }
} }