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.
+ * scr/global.c (thanks_for_all_the_fish): Rename three variables.
2016-03-01 Benno Schulenberg <bensberg@justemail.net>
* src/rcfile.c (parse_syntax), src/color.c (color_update): Don't
#ifndef DISABLE_COLOR
free(syntaxstr);
while (syntaxes != NULL) {
- syntaxtype *bill = syntaxes;
+ syntaxtype *sint = syntaxes;
+ syntaxes = syntaxes->next;
- free(syntaxes->name);
- free(syntaxes->linter);
- free(syntaxes->formatter);
+ free(sint->name);
+ free(sint->linter);
+ free(sint->formatter);
- while (syntaxes->extensions != NULL) {
- regexlisttype *bob = syntaxes->extensions;
- syntaxes->extensions = bob->next;
- free(bob->full_regex);
- free(bob);
+ while (sint->extensions != NULL) {
+ regexlisttype *item = sint->extensions;
+ sint->extensions = sint->extensions->next;
+ free(item->full_regex);
+ free(item);
}
- while (syntaxes->headers != NULL) {
- regexlisttype *bob = syntaxes->headers;
- syntaxes->headers = bob->next;
- free(bob->full_regex);
- free(bob);
+ while (sint->headers != NULL) {
+ regexlisttype *item = sint->headers;
+ sint->headers = sint->headers->next;
+ free(item->full_regex);
+ free(item);
}
- while (syntaxes->magics != NULL) {
- regexlisttype *bob = syntaxes->magics;
- syntaxes->magics = bob->next;
- free(bob->full_regex);
- free(bob);
+ while (sint->magics != NULL) {
+ regexlisttype *item = sint->magics;
+ sint->magics = sint->magics->next;
+ free(item->full_regex);
+ free(item);
}
- while (syntaxes->color != NULL) {
- colortype *bob = syntaxes->color;
- syntaxes->color = bob->next;
- free(bob->start_regex);
- if (bob->start != NULL) {
- regfree(bob->start);
- free(bob->start);
+ while (sint->color != NULL) {
+ colortype *ink = sint->color;
+ sint->color = sint->color->next;
+ free(ink->start_regex);
+ if (ink->start != NULL) {
+ regfree(ink->start);
+ free(ink->start);
}
- free(bob->end_regex);
- if (bob->end != NULL) {
- regfree(bob->end);
- free(bob->end);
+ free(ink->end_regex);
+ if (ink->end != NULL) {
+ regfree(ink->end);
+ free(ink->end);
}
- free(bob);
+ free(ink);
}
- syntaxes = syntaxes->next;
- free(bill);
+
+ free(sint);
}
#endif /* !DISABLE_COLOR */
#ifndef DISABLE_HISTORIES