Index: pylib/gyp/msvs_emulation.py |
diff --git a/pylib/gyp/msvs_emulation.py b/pylib/gyp/msvs_emulation.py |
index eb9e0affeb035b66494c0f7bf6384092afa54d7f..60936341d1f501f2e9c59dd71a48ccd4fee0eb29 100644 |
--- a/pylib/gyp/msvs_emulation.py |
+++ b/pylib/gyp/msvs_emulation.py |
@@ -53,7 +53,18 @@ def QuoteForRspFile(arg): |
def EncodeRspFileList(args): |
"""Process a list of arguments using QuoteCmdExeArgument.""" |
- return ' '.join(QuoteForRspFile(arg) for arg in args) |
+ # Note that the first argument is assumed to be the command. We take extra |
+ # steps to make sure that calls to .bat files are handled correctly, and |
+ # that paths are normalized and quoted as necessary. |
+ program = args[0] if args else '' |
Nico
2012/05/01 17:17:26
nit: I'd `if not args: return ''` at the top inste
scottmg
2012/05/01 18:40:14
Done.
|
+ if program.startswith('call '): |
+ call, space, batch = program.partition(' ') |
Nico
2012/05/01 17:17:26
call, batch = program.split(' ', 1) ? Or at least
scottmg
2012/05/01 18:40:14
I always forget about [, maxsplit] on split for so
|
+ program = 'call ' + QuoteForRspFile(os.path.normpath(batch)) |
+ else: |
+ program = os.path.normpath(program) |
+ if ' ' in program: |
+ program = QuoteForRspFile(program) |
Nico
2012/05/01 17:17:26
You do this here only if ' ' in program, but uncon
scottmg
2012/05/01 18:40:14
Yes, unfortunately. Not adding the quotes here han
|
+ return program + ' ' + ' '.join(QuoteForRspFile(arg) for arg in args[1:]) |
def _GenericRetrieve(root, default, path): |