From 102bfed4b4549d036a4af82b0c879009ac08856f Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Sun, 15 Nov 2015 06:42:19 +0000 Subject: [PATCH] Backport r5335 from trunk. git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_4_branch@5411 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ src/nano.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fb3a69a..a68a072d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-08-01 Benno Schulenberg + * src/nano.c (precalc_multicolorinfo): Set each multiline-color + value instead of OR-ing it. This fixes Savannah bug #45640. + 2015-07-29 Benno Schulenberg * src/text.c (do_linter): When the linter is called in restricted mode (possible when nano was built with --disable-speller), it is better to diff --git a/src/nano.c b/src/nano.c index 7fc8a429..534ccb31 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1894,7 +1894,7 @@ void precalc_multicolorinfo(void) if (regexec(tmpcolor->end, &fileptr->data[startx], 1, &endmatch, (startx == 0) ? 0 : REG_NOTBOL) == 0) { startx += endmatch.rm_eo; - fileptr->multidata[tmpcolor->id] |= CSTARTENDHERE; + fileptr->multidata[tmpcolor->id] = CSTARTENDHERE; #ifdef DEBUG fprintf(stderr, "end found on this line\n"); #endif @@ -1928,7 +1928,7 @@ void precalc_multicolorinfo(void) #endif /* We found it, we found it, la la la la la. Mark all * the lines in between and the end properly. */ - fileptr->multidata[tmpcolor->id] |= CENDAFTER; + fileptr->multidata[tmpcolor->id] = CENDAFTER; #ifdef DEBUG fprintf(stderr, "marking line %ld as CENDAFTER\n", (long)fileptr->lineno); #endif @@ -1940,7 +1940,7 @@ void precalc_multicolorinfo(void) #endif } alloc_multidata_if_needed(endptr); - fileptr->multidata[tmpcolor->id] |= CBEGINBEFORE; + fileptr->multidata[tmpcolor->id] = CBEGINBEFORE; #ifdef DEBUG fprintf(stderr, "marking line %ld as CBEGINBEFORE\n", (long)fileptr->lineno); #endif -- 2.39.5