From 9e6f995d3f39e4b21bdb40350154335d308f5f1b Mon Sep 17 00:00:00 2001 From: "kuchhal@chromium.org" Date: Fri, 5 Dec 2008 22:40:09 +0000 Subject: * 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 --- chrome/installer/util/shell_util.cc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'chrome/installer') 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; } -- cgit v1.1