Module: wine Branch: master Commit: 9375fd9fd3fd7308ad4741bf3b04eb1df7694c52 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9375fd9fd3fd7308ad4741bf3b...
Author: Mike McCormack mike@codeweavers.com Date: Fri Oct 27 17:29:02 2006 +0900
msi: Remove redundant null checks before MSI_EvaluateCondition.
---
dlls/msi/action.c | 35 +++++++++++++---------------------- 1 files changed, 13 insertions(+), 22 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 161a2d6..e7ba6a2 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -700,12 +700,10 @@ static UINT ACTION_PerformActionSequence
/* check conditions */ cond = MSI_RecordGetString(row,2); - if (cond) - { - /* this is a hack to skip errors in the condition code */ - if (MSI_EvaluateConditionW(package, cond) == MSICONDITION_FALSE) - goto end; - } + + /* this is a hack to skip errors in the condition code */ + if (MSI_EvaluateConditionW(package, cond) == MSICONDITION_FALSE) + goto end;
action = MSI_RecordGetString(row,1); if (!action) @@ -743,20 +741,17 @@ static UINT ITERATE_Actions(MSIRECORD *r if (!action) { ERR("Error is retrieving action name\n"); - return ERROR_FUNCTION_FAILED; + return ERROR_FUNCTION_FAILED; }
/* check conditions */ cond = MSI_RecordGetString(row,2); - if (cond) + + /* this is a hack to skip errors in the condition code */ + if (MSI_EvaluateConditionW(iap->package, cond) == MSICONDITION_FALSE) { - /* this is a hack to skip errors in the condition code */ - if (MSI_EvaluateConditionW(iap->package, cond) == MSICONDITION_FALSE) - { - TRACE("Skipping action: %s (condition is false)\n", - debugstr_w(action)); - return ERROR_SUCCESS; - } + TRACE("Skipping action: %s (condition is false)\n", debugstr_w(action)); + return ERROR_SUCCESS; }
if (iap->UI) @@ -2044,14 +2039,10 @@ static UINT ACTION_CostFinalize(MSIPACKA TRACE("Enabling or Disabling Components\n"); LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry ) { - if (comp->Condition) + if (MSI_EvaluateConditionW(package, comp->Condition) == MSICONDITION_FALSE) { - if (MSI_EvaluateConditionW(package, - comp->Condition) == MSICONDITION_FALSE) - { - TRACE("Disabling component %s\n", debugstr_w(comp->Component)); - comp->Enabled = FALSE; - } + TRACE("Disabling component %s\n", debugstr_w(comp->Component)); + comp->Enabled = FALSE; } }