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 4fc383ab86bed3bb094798d144231fb5493a1051..e8fd6aa1f4921b467aa284a23438fa0031663e2f 100644 |
| --- a/chrome/installer/util/install_util.cc |
| +++ b/chrome/installer/util/install_util.cc |
| @@ -393,7 +393,16 @@ bool InstallUtil::IsPerUserInstall(const base::FilePath& exe_path) { |
| env->SetVar(kEnvProgramFilesPath, |
| base::WideToUTF8(program_files_path.value())); |
| } |
| - return !base::StartsWith(exe_path.value(), program_files_path.value(), false); |
| + |
| + // Return true if the program files path is not a case-insensitive prefix of |
| + // the exe path. |
| + if (exe_path.value().size() < program_files_path.value().size()) |
| + return true; |
| + DWORD prefix_len = static_cast<DWORD>(program_files_path.value().size()); |
|
grt (UTC plus 2)
2015/07/01 17:55:42
base::saturated_cast<DWORD, size_t>()?
|
| + return ::CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, |
| + exe_path.value().data(), prefix_len, |
| + program_files_path.value().data(), prefix_len) != |
| + CSTR_EQUAL; |
| } |
| bool InstallUtil::IsMultiInstall(BrowserDistribution* dist, |