Commit 26eed9d4 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Removing a condition that can never occur.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5376 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 8 additions and 8 deletions
+8 -8
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
* src/text.c (do_redo): For an INSERT, 'u->mark_begin_lineno' is not * src/text.c (do_redo): For an INSERT, 'u->mark_begin_lineno' is not
an actual line number, so spoof it. It can be spoofed, because 'f' an actual line number, so spoof it. It can be spoofed, because 'f'
is not used for the INSERT case. This fixes Savannah bug #45524. is not used for the INSERT case. This fixes Savannah bug #45524.
* src/text.c (do_redo): Remove a condition that can never occur.
Also rewrite a loop to become somewhat clearer.
2015-10-27 Benno Schulenberg <bensberg@justemail.net> 2015-10-27 Benno Schulenberg <bensberg@justemail.net>
* src/move.c (do_next_word): Rewrite this function to use the same * src/move.c (do_next_word): Rewrite this function to use the same
......
...@@ -624,20 +624,18 @@ void do_undo(void) ...@@ -624,20 +624,18 @@ void do_undo(void)
/* Redo the last thing(s) we undid. */ /* Redo the last thing(s) we undid. */
void do_redo(void) void do_redo(void)
{ {
undo *u = openfile->undotop;
size_t len = 0; size_t len = 0;
char *data, *redidmsg = NULL; char *data, *redidmsg = NULL;
undo *u = openfile->undotop;
for (; u != NULL && u->next != openfile->current_undo; u = u->next) /* Get the previous undo item. */
; while (u->next != openfile->current_undo && u != NULL)
if (!u) { u = u->next;
if (u == NULL) {
statusbar(_("Nothing to re-do!")); statusbar(_("Nothing to re-do!"));
return; return;
} }
if (u->next != openfile->current_undo) {
statusbar(_("Internal error: cannot set up redo. Please save your work."));
return;
}
filestruct *f = fsfromline(u->type == INSERT ? 1 : u->mark_begin_lineno); filestruct *f = fsfromline(u->type == INSERT ? 1 : u->mark_begin_lineno);
if (!f) { if (!f) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment