From: Benno Schulenberg Date: Tue, 1 Dec 2015 12:49:17 +0000 (+0000) Subject: Renaming a label and eliding an 'else'. X-Git-Tag: v2.5.0~21 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=eee07d5755c7b52386b81aaea79a90942337c2ee;p=nano.git Renaming a label and eliding an 'else'. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5462 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index e8ff7e00..f72fb4fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * src/files.c (do_insertfile): Rename two variables for clarity. * src/text.c (redo_cut): Delete two redundant assignments. * src/winio.c (edit_draw): Move a check to a better place. + * src/winio.c (edit_draw): Rename a label and elide an 'else'. 2015-11-30 Benno Schulenberg * src/text.c (redo_cut, update_undo): When cutting reaches the EOF, diff --git a/src/winio.c b/src/winio.c index 0aa56713..50cab891 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2560,19 +2560,19 @@ void edit_draw(filestruct *fileptr, const char *converted, int /* First see if the multidata was maybe already calculated. */ if (fileptr->multidata[tmpcolor->id] == CNONE) - goto end_of_loop; + goto tail_of_loop; else if (fileptr->multidata[tmpcolor->id] == CWHOLELINE) { mvwaddnstr(edit, line, 0, converted, -1); - goto end_of_loop; + goto tail_of_loop; } else if (fileptr->multidata[tmpcolor->id] == CBEGINBEFORE) { regexec(tmpcolor->end, fileptr->data, 1, &endmatch, 0); /* If the coloured part is scrolled off, skip it. */ if (endmatch.rm_eo <= startpos) - goto end_of_loop; + goto tail_of_loop; paintlen = actual_x(converted, strnlenpt(fileptr->data, endmatch.rm_eo) - start); mvwaddnstr(edit, line, 0, converted, paintlen); - goto end_of_loop; + goto tail_of_loop; } if (fileptr->multidata[tmpcolor->id] == -1) /* Assume this until proven otherwise below. */ fileptr->multidata[tmpcolor->id] = CNONE; @@ -2609,8 +2609,9 @@ void edit_draw(filestruct *fileptr, const char *converted, int /* Skip over a zero-length regex match. */ if (startmatch.rm_so == startmatch.rm_eo) - startmatch.rm_eo++; - else { + goto tail_of_loop; + + { /* Now start_line is the first line before fileptr * containing a start match. Is there a start on * this line not followed by an end on this line? */ @@ -2677,7 +2678,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int /* If the whole line has been painted, don't bother * looking for any more starts. */ if (paintlen < 0) - goto end_of_loop; + goto tail_of_loop; step_two: /* Second step: look for starts on this line, but start * looking only after an end match, if there is one. */ @@ -2760,7 +2761,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int } } } - end_of_loop: + tail_of_loop: wattroff(edit, A_BOLD); wattroff(edit, COLOR_PAIR(tmpcolor->pairnum)); }