nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 21d0755de5a6021b7dc0493bd0b30390a886ec2a
parent bbab9e2e625837e719341bd6e379ab4fa5bb6c3d
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sun, 23 Jun 2019 11:37:38 +0200

tweaks: try the allocation of a multidata cache just once per line

It does not need to be allocated for each multiline regex separately.

Diffstat:
Msrc/color.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/color.c b/src/color.c @@ -295,13 +295,13 @@ void check_the_multis(linestruct *line) if (openfile->syntax == NULL || openfile->syntax->nmultis == 0) return; + alloc_multidata_if_needed(line); + for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) { /* If it's not a multiline regex, skip. */ if (ink->end == NULL) continue; - alloc_multidata_if_needed(line); - astart = (regexec(ink->start, line->data, 1, &startmatch, 0) == 0); afterstart = line->data + (astart ? startmatch.rm_eo : 0); anend = (regexec(ink->end, afterstart, 1, &endmatch, 0) == 0);