summaryrefslogtreecommitdiff
path: root/lib/fs.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-04-14 01:11:21 +0000
committerRyan Dahl <ry@tinyclouds.org>2011-04-14 01:11:21 +0000
commit598792ba91a32d2c386b0394c20d87a69ecbbc61 (patch)
treea675af483a1f937eb71011e368943af2afcb5490 /lib/fs.js
parentac1da4b4073f77f329b8bdff974e33840a7598b8 (diff)
parentd0e84b0088a865ed59afd4854b40a3eaf864928b (diff)
downloadnode-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.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/fs.js b/lib/fs.js
index efcc7a8431..89dc2142b3 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -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;