+ if (explode_mod) {
+ char buf[MAXPATHLEN*2], *texts[MAXPATHLEN];
+ int pos = 0, cnt = 0, ndx = 0, len = strlen(text);
+
+ if (empty_at_start)
+ texts[ndx++] = "";
+ /* An empty string must turn into at least one empty array item. */
+ while (1) {
+ texts[ndx] = buf + ndx * (explode_mod + 1);
+ strlcpy(texts[ndx++], text + pos, explode_mod + 1);
+ if (pos + explode_mod >= len)
+ break;
+ pos += explode_mod;
+ if (!(++cnt % empties_mod))
+ texts[ndx++] = "";
+ }
+ if (empty_at_end)
+ texts[ndx++] = "";
+ texts[ndx] = NULL;
+ matched = wildmatch_array(pattern, (const char**)texts, 0);
+ } else
+ matched = wildmatch(pattern, text);