commit 5c27d723c93a376d40016bfa5dd01d4d97cfa59a
parent 447f1b4b75cca42b5b14c8fb2ed4331cc7a107ae
Author: Chris Allegretta <chrisa@asty.org>
Date: Sat, 9 Aug 2008 09:28:07 +0000
* text.c (do_redo): Fix improperly restoring the text when redoing a line split.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4298 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Diffstat:
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,6 +1,7 @@
2008-08-08 Chris Allegretta <chrisa@asty.org>
- * files.c: Do not go on and attempt to write the main file if writing the backup file failed,
+ * files.c (write_file): Do not go on and attempt to write the main file if writing the backup file failed,
related to Savannah bug 24000.
+ * text.c (do_redo): Fix improperly restoring the text when redoing a line split.
2008-07-23 Chris Allegretta <chrisa@asty.org>
* text.c: Reset openfile-> to OTHER after an undo or redo so we don't mistakenly
diff --git a/src/files.c b/src/files.c
@@ -1540,7 +1540,6 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
free(backupname);
}
- skip_backup:
#endif /* !NANO_TINY */
/* If NOFOLLOW_SYMLINKS is set and the file is a link, we aren't
diff --git a/src/text.c b/src/text.c
@@ -551,7 +551,7 @@ void do_redo(void)
case SPLIT:
undidmsg = _("line split");
t = make_new_node(f);
- t->data = mallocstrcpy(NULL, u->strdata);
+ t->data = mallocstrcpy(NULL, &u->strdata[u->begin]);
data = mallocstrncpy(NULL, f->data, u->begin);
data[u->begin] = '\0';
free(f->data);