diff options
author | Andrea Weikert <elubie@gmx.net> | 2011-06-02 16:44:59 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2011-06-02 16:44:59 +0400 |
commit | b4872b84c87ee5c7feade2fe684cd5823bf4c078 (patch) | |
tree | e90af136c9041ba46329ffd3e3d319c8e32348fb /source/blender/blenkernel/intern/blender.c | |
parent | 1ba4550d2786bf5348d43a7285d37a66d53d461e (diff) |
fix for [#27410] Manual save kills actual .blend file if disk space is low
- moved do_history into WM_write_file after successful write of .blend@ temporary file
- Added new file flag, to avoid writing history on writing the startup.blend, autosave files and undo.
Thanks Campbell, Brecht for review!
Diffstat (limited to 'source/blender/blenkernel/intern/blender.c')
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 2fce1175fe1..b852629e49c 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -523,7 +523,8 @@ void BKE_write_undo(bContext *C, const char *name) static int counter= 0; char filepath[FILE_MAXDIR+FILE_MAXFILE]; char numstr[32]; - + int fileflags = G.fileflags & ~(G_FILE_HISTORY); /* don't do file history on undo */ + /* calculate current filepath */ counter++; counter= counter % U.undosteps; @@ -531,7 +532,7 @@ void BKE_write_undo(bContext *C, const char *name) BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter); BLI_make_file_string("/", filepath, btempdir, numstr); - success= BLO_write_file(CTX_data_main(C), filepath, G.fileflags, NULL, NULL); + success= BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL); BLI_strncpy(curundo->str, filepath, sizeof(curundo->str)); } |