replacing: do not try to wipe nonexistent multidata, to avoid crashing

This fixes https://savannah.gnu.org/bugs/?58970.
Reported-by: Matteo Raso <mraso@uoguelph.ca>

Bug existed since version 5.0, commit 569d0056.
master
Benno Schulenberg 2020-08-17 10:05:25 +02:00
parent fb98f0ced7
commit 4b6090ded3
1 changed files with 3 additions and 2 deletions

View File

@ -493,8 +493,9 @@ char *replace_line(const char *needle)
void wipe_and_recalculate_colorinfo(void)
{
for (linestruct *line = openfile->filetop; line != NULL; line = line->next)
for (short index = 0; index < openfile->syntax->nmultis; index++)
line->multidata[index] = -1;
if (line->multidata)
for (short index = 0; index < openfile->syntax->nmultis; index++)
line->multidata[index] = -1;
precalc_multicolorinfo();
}