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 <kindall@gmail.com>

Bug existed since version 5.0, since the indicator was introduced.
This commit is contained in:
Benno Schulenberg 2020-08-04 09:37:45 +02:00
parent 551a971e16
commit c8a87b4d2a
1 changed files with 3 additions and 0 deletions

View File

@ -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++;
}