summaryrefslogtreecommitdiff
path: root/app/bin/cundo.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-03-19 19:56:15 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-03-19 19:56:15 +0100
commit1542c122b3672fe83e027411ad2445772e2d0ed3 (patch)
treee535bc621bd7ffa9d5ce89e0d495df5d1c4ab6fd /app/bin/cundo.c
parent773810e6583142d7d15263e6481c42aebed6d7f1 (diff)
parentd1a8285f818eb7e5c3d6a05709ea21a808490b8c (diff)
Update upstream source from tag 'upstream/5.1.0'
Update to upstream version '5.1.0' with Debian dir 93ca74b8b4602fce4c9c7740e0cfdde25f086673
Diffstat (limited to 'app/bin/cundo.c')
-rw-r--r--app/bin/cundo.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/app/bin/cundo.c b/app/bin/cundo.c
index 13d7af0..e27ee75 100644
--- a/app/bin/cundo.c
+++ b/app/bin/cundo.c
@@ -24,9 +24,18 @@
#include <time.h>
#include <stdarg.h>
#include <errno.h>
+#include <string.h>
+
+#include "cselect.h"
+#include "custom.h"
+#include "fileio.h"
+#include "i18n.h"
+#include "messages.h"
+#include "paths.h"
#include "track.h"
#include "trackx.h"
-#include "i18n.h"
+#include "cundo.h"
+
/*****************************************************************************
*
@@ -148,10 +157,11 @@ static BOOL_T UndoFail( char * cause, long val, char * fileName, int lineNumber
undoStack_p us;
FILE * outf;
time_t clock;
- char temp[STR_SIZE];
+ char *temp;
NoticeMessage( MSG_UNDO_ASSERT, _("Ok"), NULL, fileName, lineNumber, val, val, cause );
- sprintf( temp, "%s%s%s", workingDir, FILE_SEP_CHAR, sUndoF );
+ MakeFullpath(&temp, workingDir, sUndoF, NULL);
outf = fopen( temp, "a+" );
+ free(temp);
if ( outf == NULL ) {
NoticeMessage( MSG_OPEN_FAIL, _("Ok"), NULL, _("Undo Trace"), temp, strerror(errno) );
return FALSE;
@@ -361,6 +371,7 @@ static BOOL_T ReadObject( stream_p stream, BOOL_T needRedo )
tempTrk.extraData = trk->extraData;
if (!ReadStream( stream, tempTrk.extraData, tempTrk.extraSize ))
return FALSE;
+ RebuildTrackSegs(&tempTrk); //If we had an array of Segs - recreate it
if (recordUndo) Rprintf( "Restore T%D(%d) @ %lx\n", trk->index, tempTrk.index, (long)trk );
tempTrk.index = trk->index;
tempTrk.next = trk->next;