summaryrefslogtreecommitdiff
path: root/app/bin/cundo.c
diff options
context:
space:
mode:
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;