tweaks: stop checking for a NULL result from line_from_number()

No one ever reported seeing the message that was removed in commit
c039aaad one month ago, so most likely the code is correct and nano
never calls line_from_number() with a non-existent line number.
master
Benno Schulenberg 2019-05-24 19:02:14 +02:00
parent 93edd12099
commit 98ffb19746
2 changed files with 3 additions and 12 deletions

View File

@ -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:

View File

@ -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 */