diff --git a/lib/less/index.js b/lib/less/index.js index 64dbc5b..9547ad8 100644 --- a/lib/less/index.js +++ b/lib/less/index.js @@ -99,24 +99,16 @@ less.Parser.importer = function (file, paths, callback) { } if (pathname) { - fs.stat(pathname, function (e, stats) { - if (e) sys.error(e); + fs.readFile(pathname, 'utf-8', function(e, data) { + if (e) sys.error(e); - fs.open(pathname, process.O_RDONLY, stats.mode, function (e, fd) { - if (e) sys.error(e); - - fs.read(fd, stats.size, 0, "utf8", function (e, data) { - if (e) sys.error(e); - - new(less.Parser)({ - paths: [path.dirname(pathname)], - filename: pathname - }).parse(data, function (e, root) { - if (e) less.writeError(e); - callback(root); - }); - }); - }); + new(less.Parser)({ + paths: [path.dirname(pathname)], + filename: pathname + }).parse(data, function (e, root) { + if (e) less.writeError(e); + callback(root); + }); }); } else { sys.error("file '" + file + "' wasn't found.\n");