From 0d85a798e5c8d376af7de28038ec3b847aac5bdf Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 21 Feb 2022 10:42:29 +0100 Subject: [PATCH] painting: look for another start match only after the actual end match The 'endmatch.rm_eo' value is relative to the end of the start match, so to find the end of the end match, one has to add 'startmatch.rm_eo' plus 'endmatch.rm_eo' to the starting point of the line. This addresses https://savannah.gnu.org/bugs/?62091. Problem existed since version 5.6, commit 0596b875. --- src/color.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/color.c b/src/color.c index 3ffbe3df..a04982cb 100644 --- a/src/color.c +++ b/src/color.c @@ -259,8 +259,8 @@ void check_the_multis(linestruct *line) if (!astart && !anend) continue; } else if (line->multidata[ink->id] == JUSTONTHIS) { - if (astart && anend && regexec(ink->start, line->data + endmatch.rm_eo, - 1, &startmatch, 0) != 0) + if (astart && anend && regexec(ink->start, line->data + startmatch.rm_eo + + endmatch.rm_eo, 1, &startmatch, 0) != 0) continue; } else if (line->multidata[ink->id] == STARTSHERE) { if (astart && !anend)