From 86bbe50a3b8c42f87c9c7f3a5ede58d0546e0823 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 16 Aug 2015 17:53:28 +0000 Subject: [PATCH] Discarding an unneeded extra freeing of the help text. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5366 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/help.c | 16 ++++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d49e6f9b..e1d91037 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,9 @@ when they will be intialized right away. * src/files.c (make_new_buffer): Don't bother with a separate function when it's used only once, right there. + * src/help.c (help_init): Since the new SIGWINCH handling, a resizing + of the window will no longer break out of the help viewer, so there is + no need any more for an extra freeing of the help text. 2015-08-13 Benno Schulenberg * src/search.c (do_find_bracket): Remove mistaken comparison between diff --git a/src/help.c b/src/help.c index e473f405..8b3a0d5a 100644 --- a/src/help.c +++ b/src/help.c @@ -183,15 +183,12 @@ void do_help(void) #endif edit_refresh(); - /* The help_init() at the beginning allocated help_text. Since - * help_text has now been written to the screen, we don't need it - * anymore. */ + /* We're exiting from the help screen. */ free(help_text); - help_text = NULL; } -/* This function allocates help_text, and stores the help string in it. - * help_text should be NULL initially. */ +/* Allocate space for the help text for the current menu, and concatenate + * the different pieces of text into it. */ void help_init(void) { size_t allocsize = 0; @@ -390,10 +387,6 @@ void help_init(void) } #endif - /* help_text has been freed and set to NULL unless the user resized - * while in the help screen. */ - free(help_text); - /* Allocate space for the help text. */ help_text = charalloc(allocsize + 1); @@ -475,8 +468,7 @@ void help_init(void) SET(WHITESPACE_DISPLAY); #endif /* !NANO_TINY */ - /* If all went well, we didn't overwrite the allocated space for - * help_text. */ + /* If all went well, we didn't overwrite the allocated space. */ assert(strlen(help_text) <= allocsize + 1); } -- 2.39.5