struct pattern_match_data *pmd = data;
struct osl_object name_obj;
const char *p, *name;
- int i, ret = osl(osl_get_object(pmd->table, row, pmd->match_col_num, &name_obj));
- const char *pattern_txt = (const char *)pmd->patterns.data;
+ int i, ret;
+ ret = osl(osl_get_object(pmd->table, row, pmd->match_col_num,
+ &name_obj));
if (ret < 0)
return ret;
name = (char *)name_obj.data;
if ((!name || !*name) && (pmd->pm_flags & PM_SKIP_EMPTY_NAME))
return 1;
- if ((pmd->lpr && lls_num_inputs(pmd->lpr) == 0) || pmd->patterns.size == 0) {
+ if (lls_num_inputs(pmd->lpr) == 0) {
if (pmd->pm_flags & PM_NO_PATTERN_MATCHES_EVERYTHING) {
pmd->num_matches++;
return pmd->action(pmd->table, row, name, pmd->data);
}
}
- p = pattern_txt;
i = pmd->input_skip;
for (;;) {
- if (pmd->lpr) {
- if (i >= lls_num_inputs(pmd->lpr))
- break;
- p = lls_input(i, pmd->lpr);
- } else {
- if (p >= pattern_txt + pmd->patterns.size)
- break;
- }
+ if (i >= lls_num_inputs(pmd->lpr))
+ break;
+ p = lls_input(i, pmd->lpr);
ret = fnmatch(p, name, pmd->fnmatch_flags);
if (ret != FNM_NOMATCH) {
if (ret != 0)
return ret;
}
- if (pmd->lpr)
- i++;
- else
- p += strlen(p) + 1;
+ i++;
}
return 1;
}
int fnmatch_flags;
/** Obtained by deserializing the query buffer in the callback. */
struct lls_parse_result *lpr;
- /** Null-terminated array of patterns. */
- struct osl_object patterns;
/** Do not try to match the first inputs of lpr */
unsigned input_skip;
/** Data pointer passed to the action function. */