Chromium Code Reviews| Index: chrome/installer/util/install_util.cc |
| diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc |
| index 480e5df2f4e988ff508b68c32039112864949693..aff8e3743357c9ccdf63119fc22ee187cbf4062f 100644 |
| --- a/chrome/installer/util/install_util.cc |
| +++ b/chrome/installer/util/install_util.cc |
| @@ -359,22 +359,9 @@ int InstallUtil::GetInstallReturnCode(installer::InstallStatus status) { |
| void InstallUtil::MakeUninstallCommand(const std::wstring& exe_path, |
| const std::wstring& arguments, |
| CommandLine* command_line) { |
| - const bool no_program = exe_path.empty(); |
| - |
| - // Return a bunch of nothingness. |
| - if (no_program && arguments.empty()) { |
| - *command_line = CommandLine(CommandLine::NO_PROGRAM); |
| - } else { |
| - // Form a full command line string. |
| - std::wstring command; |
| - command.append(1, L'"') |
| - .append(no_program ? L"" : exe_path) |
| - .append(L"\" ") |
| - .append(arguments); |
| - |
| - // If we have a program name, return this complete command line. |
| - *command_line = CommandLine::FromString(command); |
| - } |
| + // Surround non-empty program name with simple quotes. |
| + std::wstring program(!exe_path.empty() ? L"\"" + exe_path + L"\" " : L"\"\""); |
| + *command_line = CommandLine::FromString(program + arguments); |
|
Evan Martin
2011/05/10 23:48:32
This is a little bit terrifying to me. How certai
msw
2011/05/11 02:28:12
I agree that this isn't robust quoting/escaping, b
|
| } |
| std::wstring InstallUtil::GetCurrentDate() { |