-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix infinite loop with zero-length options.
The bundled copy of GYP enters an infinite loop when it encounters a zero-length option so ensure those don't get through. The root cause is a bad guard in gyp/pylib/gyp/input.py that doesn't take into account that `'' in 'whatever'` evaluates to True. Upstream fix at https://codereview.chromium.org/1364373004/. Fixes: #744 PR-URL: #745 Reviewed-By: Nathan Rajlich <nathan@tootallnate.net>
- Loading branch information
1 parent
101bed6
commit 2ac7de0
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
var test = require('tape') | ||
var gyp = require('../lib/node-gyp') | ||
|
||
test('options in environment', function (t) { | ||
t.plan(1) | ||
|
||
// Zero-length keys should get filtered out. | ||
process.env.npm_config_ = '42' | ||
// Other keys should get added. | ||
process.env.npm_config_x = '42' | ||
// Except loglevel. | ||
process.env.npm_config_loglevel = 'debug' | ||
|
||
var g = gyp(); | ||
g.parseArgv(['rebuild']) // Also sets opts.argv. | ||
|
||
t.deepEqual(Object.keys(g.opts).sort(), ['argv', 'x']) | ||
}) |