int regex_exec(regex_t *preg, char const *subject, size_t len, regmatch_t pmatch[], size_t *nmatch)
{
int ret;
- int eflags = 0;
size_t matches;
/*
pmatch = NULL;
if (nmatch) *nmatch = 0;
matches = 0;
- eflags |= REG_NOSUB;
} else {
+ /* regexec does not seem to initialise unused elements */
matches = *nmatch;
memset(pmatch, 0, sizeof(pmatch[0]) * matches);
}
(p - subject));
return -1;
}
- /* regexec does not seem to initialise unused elements */
- ret = regexec(preg, subject, matches, pmatch, eflags);
+ ret = regexec(preg, subject, matches, pmatch, 0);
}
#else
- ret = regnexec(preg, subject, len, matches, pmatch, eflags);
+ ret = regnexec(preg, subject, len, matches, pmatch, 0);
#endif
if (ret != 0) {
if (ret != REG_NOMATCH) {