From fb372ed0a897992407b066b3157eeec45b7178ff Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 1 Jun 2018 20:32:58 +0200 Subject: [PATCH] tweaks: remove two superfluous assignments The variable 'last_action' is set at the end of these functions, serving to prevent a fresh action from being merged with an older action further down on the stack. Setting 'last_action' before exiting from undo()/redo() makes no sense. Also adjust a sideways related old Changelog item. --- ChangeLog.2007-2015 | 8 ++++---- src/text.c | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ChangeLog.2007-2015 b/ChangeLog.2007-2015 index ff3bbe93..0595dc65 100644 --- a/ChangeLog.2007-2015 +++ b/ChangeLog.2007-2015 @@ -3555,10 +3555,10 @@ GNU nano 2.1.4 - 2008.08.09 * text.c (add_undo): Fix check for multi-line cut check skips adding other new legit events. 2008-07-23 Chris Allegretta - * text.c: Reset openfile-> to OTHER after an undo or redo so we don't - mistakenly think this is an update when it's really an add. Also - fix an extra ; after an if statement which makes nano try to free - a struct which may be NULL. + * text.c: Reset openfile->last_action to OTHER after an undo or redo + so we don't mistakenly think this is an update when it's really an + add. Also fix a mistaken ; after an if statement which made nano + try to free a struct which might be NULL. GNU nano 2.1.3 - 2008.08.04 diff --git a/src/text.c b/src/text.c index 5b6bc0a3..936e8c2f 100644 --- a/src/text.c +++ b/src/text.c @@ -764,7 +764,6 @@ void do_undo(void) case SPLIT_END: goto_line_posx(u->lineno, u->begin); openfile->current_undo = openfile->current_undo->next; - openfile->last_action = OTHER; while (openfile->current_undo->type != SPLIT_BEGIN) do_undo(); u = openfile->current_undo; @@ -939,7 +938,6 @@ void do_redo(void) case SPLIT_BEGIN: goto_line_posx(u->lineno, u->begin); openfile->current_undo = u; - openfile->last_action = OTHER; while (openfile->current_undo->type != SPLIT_END) do_redo(); u = openfile->current_undo;