Commit 55852e14 authored by hefangshi's avatar hefangshi Committed by Evan Lucas
Browse files

module: fix node_modules search path in edge case

The `p < nmLen` condition will fail when a module's name is end with
`node_modules` like `foo_node_modules`. The old logic will miss the
`foo_node_modules/node_modules` in node_modules paths.

TL;TR, a module named like `foo_node_modules` can't require any module
 in the node_modules folder.

Fixes: https://github.com/nodejs/node/issues/6679
PR-URL: https://github.com/nodejs/node/pull/6670


Reviewed-By: default avatarEvan Lucas <evanlucas@me.com>
parent 5111e789
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment