From 5c160e018b5caaaa8377b72bb18441eb6177452f Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 30 Jan 2017 16:17:03 -0500 Subject: [PATCH] Windows: Fix command line parsing for crash handler (issue #1995) --- libcef/browser/context.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index b6f441796..72b74a436 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -96,8 +96,11 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) { }), argv.end()); - // HandlerMain expects the first argument to be the program name. +#if defined(OS_MACOSX) + // HandlerMain on macOS uses the system version of getopt_long which expects + // the first argument to be the program name. argv.insert(argv.begin(), command_line.GetProgram().value()); +#endif std::unique_ptr argv_as_utf8(new char*[argv.size() + 1]); std::vector storage;