mirror of
git://git.sv.gnu.org/nano.git
synced 2024-12-05 02:42:08 +03:00
undo the initialization of index, as the warning was indirectly caused
by a missing snippet of code that also broke color regex display, and add the aforementioned snippet git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2227 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
22e5eff432
commit
179f0ea742
@ -3185,7 +3185,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int
|
||||
int paintlen;
|
||||
/* Number of chars to paint on this line. There are COLS
|
||||
* characters on a whole line. */
|
||||
size_t index = 0;
|
||||
size_t index;
|
||||
/* Index in converted where we paint. */
|
||||
regmatch_t startmatch; /* match position for start_regexp */
|
||||
regmatch_t endmatch; /* match position for end_regexp */
|
||||
@ -3307,8 +3307,8 @@ void edit_add(const filestruct *fileptr, const char *converted, int
|
||||
end_line = end_line->next;
|
||||
|
||||
/* No end found, or it is too early. */
|
||||
if (end_line == NULL ||
|
||||
(end_line == fileptr && endmatch.rm_eo <= startpos))
|
||||
if (end_line == NULL || (end_line == fileptr &&
|
||||
endmatch.rm_eo <= startpos))
|
||||
goto step_two;
|
||||
|
||||
/* Now paint the start of fileptr. */
|
||||
@ -3338,6 +3338,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int
|
||||
else
|
||||
x_start = strnlenpt(fileptr->data,
|
||||
startmatch.rm_so) - start;
|
||||
index = actual_x(converted, x_start);
|
||||
if (regexec(tmpcolor->end,
|
||||
fileptr->data + startmatch.rm_eo, 1, &endmatch,
|
||||
startmatch.rm_eo == 0 ? 0 : REG_NOTBOL) == 0) {
|
||||
@ -3408,7 +3409,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int
|
||||
int paintlen;
|
||||
/* Number of chars to paint on this line. There are COLS
|
||||
* characters on a whole line. */
|
||||
size_t index = 0;
|
||||
size_t index;
|
||||
/* Index in converted where we paint. */
|
||||
|
||||
mark_order(&top, &top_x, &bot, &bot_x, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user