diff --git a/which.js b/which.js index 20f4b72..11ddc81 100644 --- a/which.js +++ b/which.js @@ -108,7 +108,7 @@ function whichSync (cmd, opt) { pathPart = pathPart.slice(1, -1) var p = path.join(pathPart, cmd) - if (!pathPart && (/^\./).test(cmd)) { + if (!pathPart && /^\.[\\\/]/.test(cmd)) { p = cmd.slice(0, 2) + p } for (var j = 0, ll = pathExt.length; j < ll; j ++) {