diff --git a/src/text.c b/src/text.c index a409fc78..afbab8b1 100644 --- a/src/text.c +++ b/src/text.c @@ -523,11 +523,8 @@ void do_undo(void) return; } - if (u->type <= REPLACE) { + if (u->type <= REPLACE) f = line_from_number(u->mark_begin_lineno); - if (f == NULL) - return; - } openfile->current_x = u->begin; switch (u->type) { @@ -695,11 +692,8 @@ void do_redo(void) while (u->next != openfile->current_undo) u = u->next; - if (u->type <= REPLACE) { + if (u->type <= REPLACE) f = line_from_number(u->mark_begin_lineno); - if (f == NULL) - return; - } switch (u->type) { case ADD: diff --git a/src/utils.c b/src/utils.c index cfa1d0a8..c661682a 100644 --- a/src/utils.c +++ b/src/utils.c @@ -507,10 +507,7 @@ linestruct *line_from_number(ssize_t lineno) while (f->lineno != lineno && f->next != NULL) f = f->next; - if (f->lineno == lineno) - return f; - else - return NULL; + return f; } #endif /* !NANO_TINY */