nano

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

commit 56a8aad848d8d91f020422dadfd26ef5fa3aa044
parent bdc038db14d81c3cb035e8738ebfbbdfbec92a51
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Tue,  1 Nov 2005 19:06:01 +0000

properly handle the case where the user resized the window while at the
statusbar prompt, in which case prompt won't be NULL when statusq() is
called


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

Diffstat:
Msrc/prompt.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/prompt.c b/src/prompt.c @@ -826,7 +826,10 @@ int statusq(bool allow_tabs, const shortcut *s, const char *curranswer, bool list = FALSE; #endif - assert(prompt == NULL); + /* prompt has been freed and set to NULL unless the user resized + * while at the statusbar prompt. */ + if (prompt != NULL) + free(prompt); prompt = charalloc(((COLS - 4) * mb_cur_max()) + 1);