FIX: LineReader.hasNextLine go to a endless loop when LineReader.buffer is empty

This commit is contained in:
perfectworks 2012-02-20 22:15:22 +08:00
parent caaee2ceec
commit 92a4dffb11

View file

@ -378,6 +378,7 @@ exports.LineReader.prototype = {
while(this.buffer.indexOf('\n') === -1) {
this.getBufferAndSetCurrentPosition(this.currentPosition);
if(this.currentPosition === -1) return false;
if(this.buffer.length === 0) return false;
}
if(this.buffer.indexOf("\n") > -1) return true;