From 548d59d07e21a54fb869345ff71ed08cbe2ffad1 Mon Sep 17 00:00:00 2001 From: Jacek Becela Date: Wed, 3 Mar 2010 11:17:45 -0700 Subject: [PATCH] Fix fs.readFile handling encoding. Should close issue #72 --- src/node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node.js b/src/node.js index 221a5a2657..12686e674c 100644 --- a/src/node.js +++ b/src/node.js @@ -310,7 +310,7 @@ function readAll (fd, pos, content, encoding, callback) { } process.fs.readFile = function (path, encoding_, callback) { - var encoding = typeof(encoding_) == 'string' ? encoding : 'utf8'; + var encoding = typeof(encoding_) == 'string' ? encoding_ : 'utf8'; var callback_ = arguments[arguments.length - 1]; var callback = (typeof(callback_) == 'function' ? callback_ : null); process.fs.open(path, process.O_RDONLY, 0666, function (err, fd) {