From e3a2dd1b13344a8347265ab0f46181de33b1b1ef Mon Sep 17 00:00:00 2001 From: Shigeki Ohtsu Date: Tue, 12 Jun 2012 16:01:03 +0900 Subject: [PATCH] fs: fix fs.readFileSync to work on real empty file --- lib/fs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fs.js b/lib/fs.js index aa0792b24b5..cedb9b16148 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -223,7 +223,7 @@ fs.readFileSync = function(path, encoding) { if (size !== 0) { done = pos >= size; } else { - done = bytesRead > 0; + done = bytesRead >= 0; } }