nano

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

commit 047936c33832db0557fc11be2bacbf8cd2777a7c
parent ca0571ea52fcec951f3c4fa32bc2b71508b9fb8f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon,  9 Mar 2020 14:28:57 +0100

tweaks: reshuffle an assignment and a free()

Diffstat:
Msrc/text.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -1863,7 +1863,7 @@ void do_justify(bool full_justify) if (openfile->mark) { size_t line_len = strlen(cutbuffer->data); - linestruct *line; + linestruct *line = cutbuffer; size_t white_len; char *afterlead; @@ -1886,9 +1886,7 @@ void do_justify(bool full_justify) /* Now justify the extracted region. */ concat_paragraph(cutbuffer, linecount); squeeze(cutbuffer, lead_len); - line = cutbuffer; rewrap_paragraph(&line, the_second_lead, second_lead_len); - free(the_second_lead); /* If the marked region started in the middle of a line, * insert a newline before the new paragraph. */ @@ -1906,6 +1904,7 @@ void do_justify(bool full_justify) line->next->data = copy_of(the_lead); } + free(the_second_lead); free(the_lead); } else #endif