From 6f681c1be2eff166cb99d8e745f6d660c65f1ab7 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Fri, 8 Aug 2008 03:02:03 +0000 Subject: [PATCH] * text.c: Reset openfile-> to OTHER after an undo or redo so we don't mistakenly 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 git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4296 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 6 ++++++ src/text.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed09d5ef..e4b5f443 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-23 Chris Allegretta + * text.c: Reset openfile-> to OTHER after an undo or redo so we don't mistakenly + 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 + GNU nano 2.1.3 - 2008.08.04 2008-07-23 Chris Allegretta * configure.ac: Add ncursesw dir to include path if lib detected diff --git a/src/text.c b/src/text.c index 5226a321..eeca2c80 100644 --- a/src/text.c +++ b/src/text.c @@ -491,7 +491,7 @@ void do_undo(void) do_gotolinecolumn(u->lineno, u->begin, FALSE, FALSE, FALSE, TRUE); statusbar(_("Undid action (%s)"), undidmsg); openfile->current_undo = openfile->current_undo->next; - + openfile->last_action = OTHER; } void do_redo(void) @@ -638,6 +638,7 @@ void do_redo(void) statusbar(_("Redid action (%s)"), undidmsg); openfile->current_undo = u; + openfile->last_action = OTHER; } #endif /* !NANO_TINY */ @@ -814,7 +815,7 @@ void add_undo(undo_type current_action) fs->undotop = fs->undotop->next; if (u2->strdata != NULL) free(u2->strdata); - if (u2->cutbuffer); + if (u2->cutbuffer) free_filestruct(u2->cutbuffer); free(u2); }