From: Ben Noordhuis Date: Fri, 28 Dec 2012 17:31:47 +0000 (+0100) Subject: fs: make 'end' work with ReadStream without 'start' X-Git-Tag: v0.9.5~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6e958d44d6674676581ced360530f85508121a2;p=platform%2Fupstream%2Fnodejs.git fs: make 'end' work with ReadStream without 'start' Make `fs.createReadStream({ end: 42 })` work. Before this commit, it worked only when used like this: `fs.createReadStream({ start: 0, end: 42 })` - only when `start` was specified by the caller. Fixes #4423. --- diff --git a/lib/fs.js b/lib/fs.js index ee918b4..137b95f 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -1403,7 +1403,7 @@ function ReadStream(path, options) { this.mode = options.hasOwnProperty('mode') ? options.mode : 438; /*=0666*/ this.start = options.hasOwnProperty('start') ? options.start : undefined; - this.end = options.hasOwnProperty('start') ? options.end : undefined; + this.end = options.hasOwnProperty('end') ? options.end : undefined; this.autoClose = options.hasOwnProperty('autoClose') ? options.autoClose : true; this.pos = undefined;