diff --git a/services/param/trigger/trigger_checker.c b/services/param/trigger/trigger_checker.c index 972ce925ec763885bc1dd62bdc6987b92c244515..4b95fbb2d09118a35e553742f757e17a4aa46798 100644 --- a/services/param/trigger/trigger_checker.c +++ b/services/param/trigger/trigger_checker.c @@ -329,20 +329,21 @@ int CheckMatchSubCondition(const char *condition, const char *input, int length) PARAM_CHECK(condition != NULL, return 0, "Invalid condition"); PARAM_CHECK(input != NULL, return 0, "Invalid input"); const char *tmp = strstr(condition, input); - if (tmp == NULL) { - return 0; - } - PARAM_LOGV("CheckMatchSubCondition Condition: '%s' content: '%s' length %d", condition, input, length); - if (((int)strlen(tmp) <= length) || (tmp[length] != '=')) { - return 0; - } - // for condition: parameter = 1 - if (tmp == condition) { - return 1; - } - // for condition: parameter1 = 1 && parameter2 = 1 - if (*(tmp - 1) == ' ') { - return 1; + while (tmp != NULL) + { + PARAM_LOGV("CheckMatchSubCondition Condition: '%s' content: '%s' length %d", condition, input, length); + if (((int)strlen(tmp) <= length) || (tmp[length] != '=')) { + return 0; + } + // for condition: parameter = 1 + if (tmp == condition) { + return 1; + } + // for condition: parameter1 = 1 && parameter2 = 1 + if (*(tmp - 1) == ' ') { + return 1; + } + tmp = strstr(tmp + 1, input); } return 0; -} +} \ No newline at end of file