color: recompile the file-probing regexes a little faster with REG_NOSUB

When the filename, header-line, and magic regexes are first compiled
while reading in the rc files (to check their validity), REG_NOSUB is
used, but for some reason this wasn't done when each of these regexes
gets recompiled in order to be used.  Fix this oversight.  It shaves
some twenty percent off of each of these regexes' compiling time.
This commit is contained in:
Benno Schulenberg 2021-01-21 12:18:44 +01:00
parent 0122119a44
commit a19a7820f9
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ bool found_in_list(regexlisttype *head, const char *shibboleth)
regex_t rgx;
for (item = head; item != NULL; item = item->next) {
regcomp(&rgx, item->full_regex, NANO_REG_EXTENDED);
regcomp(&rgx, item->full_regex, NANO_REG_EXTENDED | REG_NOSUB);
if (regexec(&rgx, shibboleth, 0, NULL, 0) == 0) {
regfree(&rgx);