diff options
author | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 01:19:50 +0000 |
---|---|---|
committer | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-25 01:19:50 +0000 |
commit | 65b6c1aa0dca8cace4a81b1c5eb787a7e937ff0f (patch) | |
tree | 529226c8dae316507d82f3e390455668e719750b /remoting/host/simple_host_process.cc | |
parent | 4308801ad9a5d7bad08786754bdec70fae6fd6c9 (diff) | |
download | chromium_src-65b6c1aa0dca8cace4a81b1c5eb787a7e937ff0f.zip chromium_src-65b6c1aa0dca8cace4a81b1c5eb787a7e937ff0f.tar.gz chromium_src-65b6c1aa0dca8cace4a81b1c5eb787a7e937ff0f.tar.bz2 |
Fix host auth scripts to work with Windows.
Fix simple_host to work when \Users\<username> is on a different drive than the chrome repository.
BUG=none
TEST=run scripts & host process on Windows
Review URL: http://codereview.chromium.org/2822029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/simple_host_process.cc')
-rw-r--r-- | remoting/host/simple_host_process.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc index 09f6a96..0f12c43 100644 --- a/remoting/host/simple_host_process.cc +++ b/remoting/host/simple_host_process.cc @@ -43,12 +43,13 @@ #if defined(OS_WIN) const std::wstring kDefaultConfigPath = L".ChromotingConfig.json"; +const wchar_t kHomeDrive[] = L"HOMEDRIVE"; const wchar_t kHomePath[] = L"HOMEPATH"; const wchar_t* GetEnvironmentVar(const wchar_t* x) { return _wgetenv(x); } #else -static char* GetEnvironmentVar(const char* x) { return getenv(x); } -const char kHomePath[] = "HOME"; const std::string kDefaultConfigPath = ".ChromotingConfig.json"; +const char kHomePath[] = "HOME"; +static char* GetEnvironmentVar(const char* x) { return getenv(x); } #endif const std::string kFakeSwitchName = "fake"; @@ -81,7 +82,13 @@ int main(int argc, char** argv) { // Check the argument to see if we should use a fake capturer and encoder. bool fake = cmd_line->HasSwitch(kFakeSwitchName); - FilePath config_path(GetEnvironmentVar(kHomePath)); +#if defined(OS_WIN) + std::wstring path = GetEnvironmentVar(kHomeDrive); + path += GetEnvironmentVar(kHomePath); +#else + std::string path = GetEnvironmentVar(kHomePath); +#endif + FilePath config_path(path); config_path = config_path.Append(kDefaultConfigPath); if (cmd_line->HasSwitch(kConfigSwitchName)) { config_path = cmd_line->GetSwitchValuePath(kConfigSwitchName); |