Fixed last line part saving

This commit is contained in:
aynik 2015-04-04 15:20:00 +02:00
parent 5a8b660d73
commit 2b5dd621d7
1 changed files with 3 additions and 3 deletions

View File

@ -27,11 +27,11 @@ function getLines(filename, from, to, callback) {
var lines = [];
var count = -1;
var left = "";
var last = "";
stream.on("data", function(data){
data = (left+data).split("\n");
if (data[data.lnegth-1]) left = data.pop();
data = (last+data).split("\n");
last = data.pop();
var next = count + data.length;
var gtn = next >= from;
var gtm = next >= to;