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-d3aeb78583b8master
parent
22e5eff432
commit
179f0ea742
|
@ -3185,7 +3185,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int
|
||||||
int paintlen;
|
int paintlen;
|
||||||
/* Number of chars to paint on this line. There are COLS
|
/* Number of chars to paint on this line. There are COLS
|
||||||
* characters on a whole line. */
|
* characters on a whole line. */
|
||||||
size_t index = 0;
|
size_t index;
|
||||||
/* Index in converted where we paint. */
|
/* Index in converted where we paint. */
|
||||||
regmatch_t startmatch; /* match position for start_regexp */
|
regmatch_t startmatch; /* match position for start_regexp */
|
||||||
regmatch_t endmatch; /* match position for end_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;
|
end_line = end_line->next;
|
||||||
|
|
||||||
/* No end found, or it is too early. */
|
/* No end found, or it is too early. */
|
||||||
if (end_line == NULL ||
|
if (end_line == NULL || (end_line == fileptr &&
|
||||||
(end_line == fileptr && endmatch.rm_eo <= startpos))
|
endmatch.rm_eo <= startpos))
|
||||||
goto step_two;
|
goto step_two;
|
||||||
|
|
||||||
/* Now paint the start of fileptr. */
|
/* Now paint the start of fileptr. */
|
||||||
|
@ -3338,6 +3338,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int
|
||||||
else
|
else
|
||||||
x_start = strnlenpt(fileptr->data,
|
x_start = strnlenpt(fileptr->data,
|
||||||
startmatch.rm_so) - start;
|
startmatch.rm_so) - start;
|
||||||
|
index = actual_x(converted, x_start);
|
||||||
if (regexec(tmpcolor->end,
|
if (regexec(tmpcolor->end,
|
||||||
fileptr->data + startmatch.rm_eo, 1, &endmatch,
|
fileptr->data + startmatch.rm_eo, 1, &endmatch,
|
||||||
startmatch.rm_eo == 0 ? 0 : REG_NOTBOL) == 0) {
|
startmatch.rm_eo == 0 ? 0 : REG_NOTBOL) == 0) {
|
||||||
|
@ -3408,7 +3409,7 @@ void edit_add(const filestruct *fileptr, const char *converted, int
|
||||||
int paintlen;
|
int paintlen;
|
||||||
/* Number of chars to paint on this line. There are COLS
|
/* Number of chars to paint on this line. There are COLS
|
||||||
* characters on a whole line. */
|
* characters on a whole line. */
|
||||||
size_t index = 0;
|
size_t index;
|
||||||
/* Index in converted where we paint. */
|
/* Index in converted where we paint. */
|
||||||
|
|
||||||
mark_order(&top, &top_x, &bot, &bot_x, NULL);
|
mark_order(&top, &top_x, &bot, &bot_x, NULL);
|
||||||
|
|
Loading…
Reference in New Issue