Chromium Code Reviews| Index: base/command_line.cc |
| diff --git a/base/command_line.cc b/base/command_line.cc |
| index 5767669ca5cb2b9003c6c18b19e4542fe21d1405..c5c2b3187e02861ed785873440efcb05649d55d7 100644 |
| --- a/base/command_line.cc |
| +++ b/base/command_line.cc |
| @@ -422,11 +422,13 @@ void CommandLine::AppendSwitchNative(const std::string& switch_string, |
| switches_[switch_string] = value; |
| } |
| -void CommandLine::AppendLooseValue(const std::wstring& value) { |
| - // TODO(evan): the quoting here is wrong, but current callers rely on it |
| - // being wrong. I have another branch which fixes all the callers. |
| +void CommandLine::AppendArg(const std::string& value) { |
| + AppendArgNative(UTF8ToWide(value)); |
|
viettrungluu
2010/08/13 20:52:58
Could you add a |DCHECK(IsStringUTF8(value));| her
|
| +} |
| + |
| +void CommandLine::AppendArgNative(const std::wstring& value) { |
| command_line_string_.append(L" "); |
| - command_line_string_.append(value); |
| + command_line_string_.append(WindowsStyleQuote(value)); |
| args_.push_back(value); |
| } |
| @@ -472,8 +474,12 @@ void CommandLine::AppendSwitchASCII(const std::string& switch_string, |
| AppendSwitchNative(switch_string, value_string); |
| } |
| -void CommandLine::AppendLooseValue(const std::wstring& value) { |
| - argv_.push_back(base::SysWideToNativeMB(value)); |
| +void CommandLine::AppendArg(const std::string& value) { |
| + AppendArgNative(value); |
|
viettrungluu
2010/08/13 20:52:58
Ditto.
|
| +} |
| + |
| +void CommandLine::AppendArgNative(const std::string& value) { |
| + argv_.push_back(value); |
| } |
| void CommandLine::AppendArguments(const CommandLine& other, |
| @@ -499,6 +505,10 @@ void CommandLine::PrependWrapper(const std::string& wrapper) { |
| #endif |
| +void CommandLine::AppendArgPath(const FilePath& path) { |
| + AppendArgNative(path.value()); |
| +} |
| + |
| void CommandLine::AppendSwitchPath(const std::string& switch_string, |
| const FilePath& path) { |
| AppendSwitchNative(switch_string, path.value()); |