Fixed not closing stream and returning

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

View File

@ -38,7 +38,8 @@ function getLines(filename, from, to, callback) {
if (gtn) lines = lines.concat(data.slice(lines.length ? 0 : from - count - 1));
if (gtm) {
stream.removeListener("end", endReached);
callback(null, lines.slice(0, to - from));
stream.close();
return callback(null, lines.slice(0, to - from));
}
count = next;
});