diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 22:10:02 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-20 22:10:02 +0000 |
commit | e5e19c3476afa746b3baec8be9ea12532452afbb (patch) | |
tree | ba04ab540e44bd0eccb371c0cf053907c4363fd3 /base/command_line.cc | |
parent | f730a913f16507bedeeca30827a66f07903fb42a (diff) | |
download | chromium_src-e5e19c3476afa746b3baec8be9ea12532452afbb.zip chromium_src-e5e19c3476afa746b3baec8be9ea12532452afbb.tar.gz chromium_src-e5e19c3476afa746b3baec8be9ea12532452afbb.tar.bz2 |
posix: port PrependCommand to Windows and use for the plugin launcher.
Review URL: http://codereview.chromium.org/88006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line.cc')
-rw-r--r-- | base/command_line.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/base/command_line.cc b/base/command_line.cc index e49254f..8fb2dcc 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -306,6 +306,15 @@ void CommandLine::AppendArguments(const CommandLine& other, switches_[i->first] = i->second; } +void CommandLine::PrependWrapper(const std::wstring& wrapper) { + // The wrapper may have embedded arguments (like "gdb --args"). In this case, + // we don't pretend to do anything fancy, we just split on spaces. + std::vector<std::wstring> wrapper_and_args; + SplitString(wrapper, ' ', &wrapper_and_args); + program_ = wrapper_and_args[0]; + command_line_string_ = wrapper + L" " + command_line_string_; +} + #elif defined(OS_POSIX) void CommandLine::AppendSwitch(const std::wstring& switch_string) { std::string ascii_switch = WideToASCII(switch_string); |