* src/color.c (found_in_list): Don't bother keeping the compiled
regular expression when it matched -- drop this tiny optimization
for when opening multiple files. Instead stop calling malloc().
+ * src/nano.h: Delete a now-unused struct member.
2016-03-01 Benno Schulenberg <bensberg@justemail.net>
* src/rcfile.c (parse_syntax), src/color.c (color_update): Don't
void free_list_item(regexlisttype *dropit)
{
free(dropit->full_regex);
- if (dropit->rgx != NULL)
- regfree(dropit->rgx);
- free(dropit->rgx);
free(dropit);
}
#endif
typedef struct regexlisttype {
char *full_regex;
/* A regex string to match things that imply a certain syntax. */
- regex_t *rgx;
- /* The compiled regex. */
struct regexlisttype *next;
/* The next regex. */
} regexlisttype;
/* Save the extension regex if it's valid. */
if (nregcomp(fileregptr, REG_NOSUB)) {
newext->full_regex = mallocstrcpy(NULL, fileregptr);
- newext->rgx = NULL;
if (endext == NULL)
endsyntax->extensions = newext;
/* Copy the regex into a struct, and hook this in at the end. */
newthing = (regexlisttype *)nmalloc(sizeof(regexlisttype));
newthing->full_regex = mallocstrcpy(NULL, regexstring);
- newthing->rgx = NULL;
newthing->next = NULL;
if (lastthing == NULL)