Permalink
Browse files

Fixing infinite recursion while searching for .jshintrc on Windows.

Closes #100, which has more details. Bug introduced in 897db69.
  • Loading branch information...
1 parent d17f329 commit ddde8b67a8eff60ee5e854e49bffcb69552da146 @domenic domenic committed Apr 11, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/cli.js
View
@@ -3,6 +3,8 @@ var fs = require('fs'),
argsparser = require('argsparser'),
hint = require('./hint');
+var rootPath = path.resolve("/");
+
function existsSync() {
var obj = fs.existsSync ? fs : path;
return obj.existsSync.apply(obj, arguments);
@@ -45,7 +47,7 @@ function _searchFile(name, dir) {
return filename;
}
- return dir === "/" ?
+ return dir === rootPath ?
null : _searchFile(name, path.normalize(path.join(dir, "..")));
}

0 comments on commit ddde8b6

Please sign in to comment.