nano

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

commit 24bc59f5c2d1f0d20ed37c3060d9dfad48800526
parent 2088bfd45db4039a505853b76fbd9db78664b7f8
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Tue, 13 May 2014 18:06:09 +0000

Freeing the lists with functions and shortcuts upon exit.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4872 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 2++
Msrc/global.c | 13++++++++++++-
2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -2,6 +2,8 @@ * src/text.c (do_linter): Make an error message somewhat clearer. * src/rcfile.c (parse_binding): Improve another error message. * doc/syntax/nanorc.nanorc: Show key names like M-6 and M-/ as valid. + * src/global.c (thanks_for_all_the_fish): Upon exit also free the + lists with functions and shortcuts. 2014-05-12 Benno Schulenberg <bensberg@justemail.net> * src/text.c (do_spell): Provide startup feedback, as for the linter. diff --git a/src/global.c b/src/global.c @@ -666,7 +666,7 @@ void shortcut_init(void) while (allfuncs != NULL) { subnfunc *f = allfuncs; - allfuncs = (allfuncs)->next; + allfuncs = allfuncs->next; free(f); } @@ -1681,6 +1681,17 @@ void thanks_for_all_the_fish(void) if (replaceage != NULL) free_filestruct(replaceage); #endif + /* Free the functions and shortcuts lists. */ + while (allfuncs != NULL) { + subnfunc *f = allfuncs; + allfuncs = allfuncs->next; + free(f); + } + while (sclist != NULL) { + subnfunc *f = sclist; + sclist = sclist->next; + free(f); + } #ifndef DISABLE_NANORC if (homedir != NULL) free(homedir);