Merge pull request #19 from perfectworks/master
LineReader.hasNextLine go to a endless loop when LineReader.buffer is empty
This commit is contained in:
commit
6caa8c9aba
1 changed files with 2 additions and 1 deletions
|
|
@ -378,6 +378,7 @@ exports.LineReader.prototype = {
|
||||||
while(this.buffer.indexOf('\n') === -1) {
|
while(this.buffer.indexOf('\n') === -1) {
|
||||||
this.getBufferAndSetCurrentPosition(this.currentPosition);
|
this.getBufferAndSetCurrentPosition(this.currentPosition);
|
||||||
if(this.currentPosition === -1) return false;
|
if(this.currentPosition === -1) return false;
|
||||||
|
if(this.buffer.length === 0) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.buffer.indexOf("\n") > -1) return true;
|
if(this.buffer.indexOf("\n") > -1) return true;
|
||||||
|
|
|
||||||
Reference in a new issue