Skip to content

Commit

Permalink
fs: make 'end' work with ReadStream without 'start'
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bnoordhuis committed Dec 28, 2012
1 parent 910e24b commit c6e958d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c6e958d

Please sign in to comment.