Skip to content

Commit 47496bf

Browse files
committed
Fix IndexError when parsing GYP files.
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 <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent b2024de commit 47496bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gyp/pylib/gyp/input.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ def MakePathRelative(to_file, fro_file, item):
20332033
gyp.common.RelativePath(os.path.dirname(fro_file),
20342034
os.path.dirname(to_file)),
20352035
item)).replace('\\', '/')
2036-
if item[-1] == '/':
2036+
if item[-1:] == '/':
20372037
ret += '/'
20382038
return ret
20392039

0 commit comments

Comments
 (0)