nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 5e1f90d8fa92466efd3290185a6aa3f84d3f86da
parent 7f3ffe854416426c2bd667d17f3bcd7343040f96
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon,  3 Jun 2019 14:37:27 +0200

tweaks: don't bother to free the content of 'extendsyntax' commands

Extending a syntax will be rather rare, so the amount of memory it
takes up will be minimal.  It's not worth the trouble to free this
memory -- it only takes time.  Plus: we don't bother to free the
memory of a syntax that gets fully redefined either.

Diffstat:
Msrc/rcfile.c | 8+-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -584,7 +584,6 @@ void parse_one_include(char *file, syntaxtype *syntax) while (extra != NULL) { char *keyword = extra->data; char *ptr = parse_next_word(extra->data); - augmentstruct *next = extra->next; nanorc = extra->filename; lineno = extra->lineno; @@ -592,16 +591,11 @@ void parse_one_include(char *file, syntaxtype *syntax) if (!parse_syntax_commands(keyword, ptr)) rcfile_error(N_("Command \"%s\" not understood"), keyword); - free(extra->filename); - free(extra->data); - free(extra); - - extra = next; + extra = extra->next; } free(syntax->filename); syntax->filename = NULL; - syntax->augmentations = NULL; opensyntax = FALSE; }