thlorenz/find-parent-dir — pull request #2 by michaelrhodes (2014-02-03 02:24:35+00:00)
Title: Prevent "." from being returned when file is not in search directories but is in cwd.

Hey, thanks for making this module; it's come in handy for a little project I've been working on. :)

So I ran into the [same issue](https://github.com/thlorenz/find-parent-dir/issues/1) as @jwalton. It turns out this happens because when you split a path that begins with a slash, the first element in the resulting array is an empty string. So in our use case, where the file being looked for only exists in the cwd, the last fs.exists call that find-parent-dir makes uses the path: `path.join('', file)`, which resolves to cwd/file.

Hope that explanation makes sense. Let me know if you'd like anything changed.