From c8a87b4d2ab8d393b8c7a49ecddbf5af3e0ea594 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 4 Aug 2020 09:37:45 +0200 Subject: [PATCH] softwrap: initialize the 'extrarows' value for the magic line correctly The make_new_node() function initializes 'extrarows' to a bad value on purpose, to catch cases like this one where it doesn't get updated properly. This fixes https://savannah.gnu.org/bugs/?58890. Reported-by: Jerry Kindall Bug existed since version 5.0, since the indicator was introduced. --- src/utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils.c b/src/utils.c index 117c2571..2b8dc2c4 100644 --- a/src/utils.c +++ b/src/utils.c @@ -431,6 +431,9 @@ void new_magicline(void) openfile->filebot->next = make_new_node(openfile->filebot); openfile->filebot->next->data = copy_of(""); openfile->filebot = openfile->filebot->next; +#ifndef NANO_TINY + openfile->filebot->extrarows = 0; +#endif openfile->totsize++; }