2015-11-26 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_redo): Not just the undoing, also the redoing of a
Backspace at EOF is a special case. This fixes Savannah bug #46532.
+ * src/text.c (do_redo): Warn about an impossible condition, instead
+ of blithely continuing. And elide an unneeded variable.
2015-11-25 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (do_output): Refreshing the whole edit window (instead
break;
#endif
case JOIN:
+ if (f->next == NULL) {
+ statusbar(_("Internal error: line is missing. Please save your work."));
+ break;
+ }
redidmsg = _("line join");
/* When the join was done by a Backspace at the tail of the file,
* and the nonewlines flag isn't set, do not join anything, as
}
f->data = charealloc(f->data, strlen(f->data) + strlen(u->strdata) + 1);
strcat(f->data, u->strdata);
- if (f->next != NULL) {
- filestruct *tmp = f->next;
- if (tmp == openfile->filebot)
- openfile->filebot = f;
- unlink_node(tmp);
- }
+ if (f->next == openfile->filebot)
+ openfile->filebot = f;
+ unlink_node(f->next);
renumber(f);
goto_line_posx(u->mark_begin_lineno, u->mark_begin_x);
break;