diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-05 22:40:09 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-05 22:40:09 +0000 |
commit | 9e6f995d3f39e4b21bdb40350154335d308f5f1b (patch) | |
tree | 98eb9cd0a6374d57b669dadd56a2ba88239c6491 /chrome/installer | |
parent | 6f863cd632d64de8947b89044594d19ee3e95298 (diff) | |
download | chromium_src-9e6f995d3f39e4b21bdb40350154335d308f5f1b.zip chromium_src-9e6f995d3f39e4b21bdb40350154335d308f5f1b.tar.gz chromium_src-9e6f995d3f39e4b21bdb40350154335d308f5f1b.tar.bz2 |
* Prevent early exit due to && operator.
BUG=5104
Review URL: http://codereview.chromium.org/13179
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/util/shell_util.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 3ad7d08..64b49e2 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -448,8 +448,8 @@ bool ShellUtil::CreateChromeDesktopShortcut(const std::wstring& chrome_exe, std::wstring shortcut_path; if (ShellUtil::GetDesktopPath(false, &shortcut_path)) { file_util::AppendToPath(&shortcut_path, shortcut_name); - ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, shortcut_path, - create_new); + ret = ShellUtil::UpdateChromeShortcut(chrome_exe, shortcut_path, + create_new); } else { ret = false; } @@ -458,8 +458,10 @@ bool ShellUtil::CreateChromeDesktopShortcut(const std::wstring& chrome_exe, std::wstring shortcut_path; if (ShellUtil::GetDesktopPath(true, &shortcut_path)) { file_util::AppendToPath(&shortcut_path, shortcut_name); - ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, shortcut_path, - create_new); + // Note we need to call the create operation and then AND the result + // with the create operation of user level shortcut. + ret = ShellUtil::UpdateChromeShortcut(chrome_exe, shortcut_path, + create_new) && ret; } else { ret = false; } @@ -480,8 +482,8 @@ bool ShellUtil::CreateChromeQuickLaunchShortcut(const std::wstring& chrome_exe, std::wstring user_ql_path; if (ShellUtil::GetQuickLaunchPath(false, &user_ql_path)) { file_util::AppendToPath(&user_ql_path, shortcut_name); - ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, user_ql_path, - create_new); + ret = ShellUtil::UpdateChromeShortcut(chrome_exe, user_ql_path, + create_new); } else { ret = false; } @@ -493,8 +495,8 @@ bool ShellUtil::CreateChromeQuickLaunchShortcut(const std::wstring& chrome_exe, std::wstring default_ql_path; if (ShellUtil::GetQuickLaunchPath(true, &default_ql_path)) { file_util::AppendToPath(&default_ql_path, shortcut_name); - ret = ret && ShellUtil::UpdateChromeShortcut(chrome_exe, default_ql_path, - create_new); + ret = ShellUtil::UpdateChromeShortcut(chrome_exe, default_ql_path, + create_new) && ret; } else { ret = false; } @@ -549,7 +551,7 @@ bool ShellUtil::RemoveChromeDesktopShortcut(int shell_change) { std::wstring shortcut_path; if (ShellUtil::GetDesktopPath(false, &shortcut_path)) { file_util::AppendToPath(&shortcut_path, shortcut_name); - ret = ret && file_util::Delete(shortcut_path, false); + ret = file_util::Delete(shortcut_path, false); } else { ret = false; } @@ -559,7 +561,7 @@ bool ShellUtil::RemoveChromeDesktopShortcut(int shell_change) { std::wstring shortcut_path; if (ShellUtil::GetDesktopPath(true, &shortcut_path)) { file_util::AppendToPath(&shortcut_path, shortcut_name); - ret = ret && file_util::Delete(shortcut_path, false); + ret = file_util::Delete(shortcut_path, false) && ret; } else { ret = false; } @@ -578,7 +580,7 @@ bool ShellUtil::RemoveChromeQuickLaunchShortcut(int shell_change) { std::wstring user_ql_path; if (ShellUtil::GetQuickLaunchPath(false, &user_ql_path)) { file_util::AppendToPath(&user_ql_path, shortcut_name); - ret = ret && file_util::Delete(user_ql_path, false); + ret = file_util::Delete(user_ql_path, false); } else { ret = false; } @@ -589,7 +591,7 @@ bool ShellUtil::RemoveChromeQuickLaunchShortcut(int shell_change) { std::wstring default_ql_path; if (ShellUtil::GetQuickLaunchPath(true, &default_ql_path)) { file_util::AppendToPath(&default_ql_path, shortcut_name); - ret = ret && file_util::Delete(default_ql_path, false); + ret = file_util::Delete(default_ql_path, false) && ret; } else { ret = false; } |