tweaks: rename a variable, to be more general and match one elsewhere

master
Benno Schulenberg 2017-01-21 17:38:21 +01:00
parent 96f50b8d55
commit 13fbf13b85
1 changed files with 10 additions and 10 deletions

View File

@ -413,7 +413,7 @@ void precalc_multicolorinfo(void)
continue; continue;
for (fileptr = openfile->fileage; fileptr != NULL; fileptr = fileptr->next) { for (fileptr = openfile->fileage; fileptr != NULL; fileptr = fileptr->next) {
int startx = 0; int index = 0;
int linelen = strlen(fileptr->data); int linelen = strlen(fileptr->data);
alloc_multidata_if_needed(fileptr); alloc_multidata_if_needed(fileptr);
@ -422,23 +422,23 @@ void precalc_multicolorinfo(void)
/* When the line contains a start match, look for an end, and if /* When the line contains a start match, look for an end, and if
* found, mark all the lines that are affected. */ * found, mark all the lines that are affected. */
while (regexec(ink->start, &fileptr->data[startx], 1, while (regexec(ink->start, &fileptr->data[index], 1,
&startmatch, (startx == 0) ? 0 : REG_NOTBOL) == 0) { &startmatch, (index == 0) ? 0 : REG_NOTBOL) == 0) {
startx += startmatch.rm_eo; index += startmatch.rm_eo;
if (startx > linelen) if (index > linelen)
break; break;
/* If there is an end match on this line, mark the line, but /* If there is an end match on this line, mark the line, but
* continue looking for other starts after it. */ * continue looking for other starts after it. */
if (regexec(ink->end, &fileptr->data[startx], 1, if (regexec(ink->end, &fileptr->data[index], 1,
&endmatch, (startx == 0) ? 0 : REG_NOTBOL) == 0) { &endmatch, (index == 0) ? 0 : REG_NOTBOL) == 0) {
fileptr->multidata[ink->id] = CSTARTENDHERE; fileptr->multidata[ink->id] = CSTARTENDHERE;
startx += endmatch.rm_eo; index += endmatch.rm_eo;
/* If both start and end are mere anchors, step ahead. */ /* If both start and end are mere anchors, step ahead. */
if (startmatch.rm_so == startmatch.rm_eo && if (startmatch.rm_so == startmatch.rm_eo &&
endmatch.rm_so == endmatch.rm_eo) endmatch.rm_so == endmatch.rm_eo)
startx += 1; index += 1;
continue; continue;
} }
@ -467,7 +467,7 @@ void precalc_multicolorinfo(void)
fileptr->multidata[ink->id] = CBEGINBEFORE; fileptr->multidata[ink->id] = CBEGINBEFORE;
/* Begin looking for a new start after the end match. */ /* Begin looking for a new start after the end match. */
startx = endmatch.rm_eo; index = endmatch.rm_eo;
} }
} }
} }