* src/color.c (color_update): Strip things bare to see the sameness.
* src/color.c (found_in_list): Factor out this triple repetition.
* src/color.c (color_update): Rename a variable for conciseness.
+ * src/color.c (nfreeregex): Elide this function, now used just once.
GNU nano 2.5.3 - 2016.02.25
}
}
-/* Clean up a regex we previously compiled. */
-void nfreeregex(regex_t **r)
-{
- assert(r != NULL);
-
- regfree(*r);
- free(*r);
- *r = NULL;
-}
-
/* Try to match the given shibboleth string with one of the regexes in
* the list starting at head. Return TRUE upon success. */
bool found_in_list(regexlisttype *head, const char *shibboleth)
if (regexec(item->ext, shibboleth, 0, NULL, 0) == 0)
return TRUE;
- if (not_compiled)
- nfreeregex(&item->ext);
+ if (not_compiled) {
+ regfree(item->ext);
+ free(item->ext);
+ item->ext = NULL;
+ }
}
return FALSE;