ryanmcgrath / wrench-js

Recursive file operations in Node.js
MIT License
435 stars 71 forks source link

LineReader.hasNextLine go to a endless loop when LineReader.buffer is empty #19

Closed e7h4n closed 12 years ago

e7h4n commented 12 years ago
   while(this.buffer.indexOf('\n') === -1) {                                
        this.getBufferAndSetCurrentPosition(this.currentPosition);           
        if(this.currentPosition === -1) return false;                        
        if(this.buffer.length === 0) return false;  // add this line                                                          
    }       
ryanmcgrath commented 12 years ago

Beautiful! Thanks for catching, will push out a point release shortly. ;)