From 75fa8552337b65e1de9f54351573f5a22d6c14e0 Mon Sep 17 00:00:00 2001 From: Allen Bauer Date: Wed, 7 Nov 2018 22:43:39 +0000 Subject: [PATCH] Quote the full path to ninja.exe. Bug: 902930 Change-Id: I5f160cd2ff7a9da603b029c894c84db1c5ed8374 Reviewed-on: https://chromium-review.googlesource.com/c/1324650 Reviewed-by: Bruce Dawson Commit-Queue: Allen Bauer --- autoninja.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autoninja.py b/autoninja.py index e927ec027..07269caea 100755 --- a/autoninja.py +++ b/autoninja.py @@ -67,9 +67,16 @@ except IOError: # be called back. ninja_exe = 'ninja.exe' if sys.platform.startswith('win') else 'ninja' +ninja_exe_path = os.path.join(SCRIPT_DIR, ninja_exe) + +# On Windows, fully quote the path so that the command processor doesn't think +# the whole output is the command. +if sys.platform.startswith('win'): + ninja_exe_path = '"' + ninja_exe_path + '"' + # Use absolute path for ninja path, # or fail to execute ninja if depot_tools is not in PATH. -args = [os.path.join(SCRIPT_DIR, ninja_exe)] + input_args[1:] +args = [ninja_exe_path] + input_args[1:] num_cores = multiprocessing.cpu_count() if not j_specified and not t_specified: