diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 21:25:06 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 21:25:06 +0000 |
commit | f9c1cb22a99fdebd0a0a7ae0cc5c669b253365cd (patch) | |
tree | 9d0e1246bf06fea12f1c667cd7e77ac5dbafb531 | |
parent | a719927a29333b208980a34f9a76f5969f7a06c3 (diff) | |
download | chromium_src-f9c1cb22a99fdebd0a0a7ae0cc5c669b253365cd.zip chromium_src-f9c1cb22a99fdebd0a0a7ae0cc5c669b253365cd.tar.gz chromium_src-f9c1cb22a99fdebd0a0a7ae0cc5c669b253365cd.tar.bz2 |
Fix for chrome_launcher.exe command line construction.
BUG=73425
TEST=NONE
Review URL: http://codereview.chromium.org/6549022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75635 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome_frame/chrome_launcher.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chrome_frame/chrome_launcher.cc b/chrome_frame/chrome_launcher.cc index af28992..c7ca618 100644 --- a/chrome_frame/chrome_launcher.cc +++ b/chrome_frame/chrome_launcher.cc @@ -143,9 +143,15 @@ bool SanitizeAndLaunchChrome(const wchar_t* command_line) { std::wstring chrome_path; if (GetChromeExecutablePath(&chrome_path)) { const wchar_t* args = PathGetArgs(command_line); + + // Build the command line string with the quoted path to chrome.exe. + std::wstring command_line; + command_line.reserve(chrome_path.size() + 2); + command_line.append(1, L'\"').append(chrome_path).append(1, L'\"'); + if (args != NULL) { - chrome_path += L" "; - chrome_path += args; + command_line += L' '; + command_line += args; } STARTUPINFO startup_info = {0}; @@ -153,7 +159,7 @@ bool SanitizeAndLaunchChrome(const wchar_t* command_line) { startup_info.dwFlags = STARTF_USESHOWWINDOW; startup_info.wShowWindow = SW_SHOW; PROCESS_INFORMATION process_info = {0}; - if (CreateProcess(NULL, &chrome_path[0], + if (CreateProcess(&chrome_path[0], &command_line[0], NULL, NULL, FALSE, 0, NULL, NULL, &startup_info, &process_info)) { // Close handles. |