Skip to content

Commit

Permalink
Fix IndexError when parsing GYP files.
Browse files Browse the repository at this point in the history
GYP automatically turns variables ending in _dir, _file or _path into
absolute paths but didn't check for empty strings.

It interacted badly with variables inherited through the environment
from npm, the `scripts-prepend-node-path=false` setting in particular
because it is turned into `npm_config_script_prepend_node_path=`.

Fixes: #1217
PR-URL: #1267
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
bnoordhuis committed Jun 8, 2018
1 parent b2024de commit 47496bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,7 @@ def MakePathRelative(to_file, fro_file, item):
gyp.common.RelativePath(os.path.dirname(fro_file),
os.path.dirname(to_file)),
item)).replace('\\', '/')
if item[-1] == '/':
if item[-1:] == '/':
ret += '/'
return ret

Expand Down

0 comments on commit 47496bf

Please sign in to comment.