gn/win: Don't strip trailing = on exec_script arguments. BUG=588799 Review URL: https://codereview.chromium.org/1721883002 Cr-Original-Commit-Position: refs/heads/master@{#376983} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: baf2794a6e1adbd276deecd16637d4829a358ed8
diff --git a/tools/gn/function_exec_script.cc b/tools/gn/function_exec_script.cc index d5e66ae..231693b 100644 --- a/tools/gn/function_exec_script.cc +++ b/tools/gn/function_exec_script.cc
@@ -171,6 +171,13 @@ // Make the command line. const base::FilePath& python_path = build_settings->python_path(); base::CommandLine cmdline(python_path); + + // CommandLine tries to interpret arguments by default. Passing "--" disables + // this for everything following the "--", so pass this as the very first + // thing to python. Python ignores a -- before the .py file, and this makes + // CommandLine let through arguments without modifying them. + cmdline.AppendArg("--"); + cmdline.AppendArgPath(script_path); if (args.size() >= 2) {