+ if ((di->flags & SEARCH_STRINGMASK) == SEARCH_REGEX)
+ {
+ if (di->match)
+ {
+ /* We feed multiple lines eventually (e.g. authors or descriptions),
+ so set REG_NEWLINE. */
+ di->regex_err =
+ regcomp(&di->regex, di->match,
+ REG_EXTENDED | REG_NOSUB | REG_NEWLINE
+ | ((di->flags & SEARCH_NOCASE) ? REG_ICASE : 0));
+#if 0
+ if (di->regex_err != 0)
+ {
+ fprintf(stderr, "Given regex failed to compile: %s\n", di->match);
+ fprintf(stderr, "regcomp error code: %d\n", di->regex_err);
+ exit(1);
+ }
+#else
+ }
+ else
+ {
+ di->flags |= (di->flags & SEARCH_STRINGMASK) | SEARCH_STRING;
+ di->regex_err = 0;
+#endif
+ }
+ }
+