diff options
Diffstat (limited to 'source/blender/blenkernel/intern/blender.c')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 5fcf3c77d3b..72d194e4d79 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -309,8 +309,8 @@ static void setup_app_data(bContext *C, BlendFileData *bfd, char *filename) #endif /* these are the same at times, should never copy to the same location */ - if(G.sce != filename) - BLI_strncpy(G.sce, filename, FILE_MAX); + if(G.main->name != filename) + BLI_strncpy(G.main->name, filename, FILE_MAX); BLI_strncpy(G.main->name, filename, FILE_MAX); /* is guaranteed current file */ @@ -410,7 +410,7 @@ int BKE_read_file_from_memfile(bContext *C, MemFile *memfile, ReportList *report { BlendFileData *bfd; - bfd= BLO_read_from_memfile(CTX_data_main(C), G.sce, memfile, reports); + bfd= BLO_read_from_memfile(CTX_data_main(C), G.main->name, memfile, reports); if (bfd) setup_app_data(C, bfd, "<memory1>"); else @@ -460,14 +460,12 @@ static UndoElem *curundo= NULL; static int read_undosave(bContext *C, UndoElem *uel) { - char scestr[FILE_MAXDIR+FILE_MAXFILE]; /* we should eventually just use G.main->name */ char mainstr[FILE_MAXDIR+FILE_MAXFILE]; int success=0, fileflags; /* This is needed so undoing/redoing doesnt crash with threaded previews going */ WM_jobs_stop_all(CTX_wm_manager(C)); - - strcpy(scestr, G.sce); /* temporal store */ + strcpy(mainstr, G.main->name); /* temporal store */ fileflags= G.fileflags; @@ -479,7 +477,6 @@ static int read_undosave(bContext *C, UndoElem *uel) success= BKE_read_file_from_memfile(C, &uel->memfile, NULL); /* restore */ - strcpy(G.sce, scestr); /* restore */ strcpy(G.main->name, mainstr); /* restore */ G.fileflags= fileflags; @@ -720,7 +717,7 @@ void BKE_undo_save_quit(void) Main *BKE_undo_get_main(Scene **scene) { Main *mainp= NULL; - BlendFileData *bfd= BLO_read_from_memfile(G.main, G.sce, &curundo->memfile, NULL); + BlendFileData *bfd= BLO_read_from_memfile(G.main, G.main->name, &curundo->memfile, NULL); if(bfd) { mainp= bfd->main; |