From 88b24bc6bbbf35bde00c55834330b56708f25897 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Mar 2021 13:30:43 +1100 Subject: Writefile: only include recovery info in auto-save & quit.blend Previously all blend files included the path they were saved, causing files distributed publicly to include users local paths. This also included developers home directories for startup & userprefs defaults & app-templates bundled with Blender. Now recovery information is only written for auto-save & quit.blend since this is the only time they're intended to be used. --- source/blender/blenloader/intern/writefile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 6fbd4b77487..4ac49d5aebb 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -870,7 +870,10 @@ static void write_global(WriteData *wd, int fileflags, Main *mainvar) fg.fileflags = (fileflags & ~G_FILE_FLAG_ALL_RUNTIME); fg.globalf = G.f; - BLI_strncpy(fg.filename, mainvar->name, sizeof(fg.filename)); + /* Write information needed for recovery. */ + if (fileflags & G_FILE_RECOVER_WRITE) { + BLI_strncpy(fg.filename, mainvar->name, sizeof(fg.filename)); + } sprintf(subvstr, "%4d", BLENDER_FILE_SUBVERSION); memcpy(fg.subvstr, subvstr, 4); -- cgit v1.2.3