Moving a check to a better place.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5461 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2015-12-01 12:35:48 +00:00
parent ae22fe03eb
commit 3d6378b153
2 changed files with 7 additions and 5 deletions

View File

@ -3,6 +3,7 @@
actually something was inserted. This fixes Savannah bug #45409.
* 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.
2015-11-30 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (redo_cut, update_undo): When cutting reaches the EOF,

View File

@ -2596,20 +2596,21 @@ void edit_draw(filestruct *fileptr, const char *converted, int
start_line = start_line->prev;
}
/* If no start was found, skip to the next step. */
if (start_line == NULL)
goto step_two;
/* If a found start has been qualified as an end earlier,
* believe it and skip to the next step. */
if (start_line != NULL && start_line->multidata != NULL &&
if (start_line->multidata != NULL &&
(start_line->multidata[tmpcolor->id] == CBEGINBEFORE ||
start_line->multidata[tmpcolor->id] == CSTARTENDHERE))
goto step_two;
/* Skip over a zero-length regex match. */
if (start_line != NULL && startmatch.rm_so == startmatch.rm_eo)
if (startmatch.rm_so == startmatch.rm_eo)
startmatch.rm_eo++;
else {
/* If no start was found, skip to the next step. */
if (start_line == NULL)
goto step_two;
/* 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? */