Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/blender_undo.c')
-rw-r--r--source/blender/blenkernel/intern/blender_undo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c
index 6b31c8c96f9..c3306b16041 100644
--- a/source/blender/blenkernel/intern/blender_undo.c
+++ b/source/blender/blenkernel/intern/blender_undo.c
@@ -66,10 +66,11 @@
bool BKE_memfile_undo_decode(MemFileUndoData *mfu, bContext *C)
{
- char mainstr[sizeof(G.main->name)];
+ Main *bmain = CTX_data_main(C);
+ char mainstr[sizeof(bmain->name)];
int success = 0, fileflags;
- BLI_strncpy(mainstr, G.main->name, sizeof(mainstr)); /* temporal store */
+ BLI_strncpy(mainstr, BKE_main_blendfile_path(bmain), sizeof(mainstr)); /* temporal store */
fileflags = G.fileflags;
G.fileflags |= G_FILE_NO_UI;
@@ -82,7 +83,7 @@ bool BKE_memfile_undo_decode(MemFileUndoData *mfu, bContext *C)
}
/* restore */
- BLI_strncpy(G.main->name, mainstr, sizeof(G.main->name)); /* restore */
+ BLI_strncpy(bmain->name, mainstr, sizeof(bmain->name)); /* restore */
G.fileflags = fileflags;
if (success) {