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.
+ * src/global.c (free_list_item): Elide this now too tiny function.
2016-03-01 Benno Schulenberg <bensberg@justemail.net>
* src/rcfile.c (parse_syntax), src/color.c (color_update): Don't
#ifdef DEBUG
-#ifndef DISABLE_COLOR
-void free_list_item(regexlisttype *dropit)
-{
- free(dropit->full_regex);
- free(dropit);
-}
-#endif
-
/* This function is used to gracefully return all the memory we've used.
* It should be called just before calling exit(). Practically, the
* only effect is to cause a segmentation fault if the various data
while (syntaxes->extensions != NULL) {
regexlisttype *bob = syntaxes->extensions;
syntaxes->extensions = bob->next;
- free_list_item(bob);
+ free(bob->full_regex);
+ free(bob);
}
while (syntaxes->headers != NULL) {
regexlisttype *bob = syntaxes->headers;
syntaxes->headers = bob->next;
- free_list_item(bob);
+ free(bob->full_regex);
+ free(bob);
}
while (syntaxes->magics != NULL) {
regexlisttype *bob = syntaxes->magics;
syntaxes->magics = bob->next;
- free_list_item(bob);
+ free(bob->full_regex);
+ free(bob);
}
while (syntaxes->color != NULL) {