diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-04-14 01:11:21 +0000 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-04-14 01:11:21 +0000 |
commit | 598792ba91a32d2c386b0394c20d87a69ecbbc61 (patch) | |
tree | a675af483a1f937eb71011e368943af2afcb5490 /lib/fs.js | |
parent | ac1da4b4073f77f329b8bdff974e33840a7598b8 (diff) | |
parent | d0e84b0088a865ed59afd4854b40a3eaf864928b (diff) | |
download | node-new-598792ba91a32d2c386b0394c20d87a69ecbbc61.tar.gz |
Merge branch 'v0.4'
Conflicts:
src/platform_sunos.cc
test/simple/test-os.js
Diffstat (limited to 'lib/fs.js')
-rw-r--r-- | lib/fs.js | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -838,11 +838,12 @@ var ReadStream = fs.ReadStream = function(path, options) { if (this.encoding) this.setEncoding(this.encoding); - if (this.start !== undefined || this.end !== undefined) { - if (this.start === undefined || this.end === undefined) { - this.emit('error', new Error('Both start and end are needed ' + - 'for range streaming.')); - } else if (this.start > this.end) { + if (this.start !== undefined) { + if (this.end === undefined) { + this.end = Infinity; + } + + if (this.start > this.end) { this.emit('error', new Error('start must be <= end')); } else { this._firstRead = true; |