Fixed not closing stream and returning
This commit is contained in:
parent
2b5dd621d7
commit
3c5b9360ed
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue