and numbers. */
int_fields[i].value.str = p_strdup(filter->pool, fields[i].value);
if (str_to_intmax(fields[i].value, &int_fields[i].value.intmax) < 0) {
- /* not a number - no problem */
+ /* not a number - no problem
+ Either we have a string, or a number with wildcards */
+ int_fields[i].value.intmax = INT_MIN;
}
}
int_query->fields_count = count;
}
return wildcard_match_icase(field->value.str, wanted_field->value.str);
case EVENT_FIELD_VALUE_TYPE_INTMAX:
- return field->value.intmax == wanted_field->value.intmax;
+ if (wanted_field->value.intmax > INT_MIN) {
+ /* compare against an integer */
+ return field->value.intmax == wanted_field->value.intmax;
+ } else {
+ /* compare against an "integer" with wildcards */
+ char tmp[MAX_INT_STRLEN];
+ i_snprintf(tmp, sizeof(tmp), "%jd", field->value.intmax);
+ return wildcard_match_icase(tmp, wanted_field->value.str);
+ }
case EVENT_FIELD_VALUE_TYPE_TIMEVAL:
/* there's no point to support matching exact timestamps */
return FALSE;