diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2010-10-21 03:13:12 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2010-10-21 03:13:12 +0400 |
commit | bfb8560a59547e178687cdf2b561c83e22f01385 (patch) | |
tree | 4fdb063aa8f16d6721959a9c56019f8cbe9936cb | |
parent | 1998fa59ae90c2346910dc622df0356a8644c28f (diff) |
Partial fix for bug #24341, "Problems running blender headless"
* Fixed the random file popping up.
* Don't write to the history file in background mode, because ghost won't give us the right directory in that case
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 00a686c0d74..6db7f2554c4 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -453,10 +453,16 @@ static void write_history(void) { struct RecentFile *recent, *next_recent; char name[FILE_MAXDIR+FILE_MAXFILE]; + char *user_config_dir; FILE *fp; int i; - BLI_make_file_string("/", name, BLI_get_folder_create(BLENDER_USER_CONFIG, NULL), BLENDER_HISTORY_FILE); + /* will be NULL in background mode */ + user_config_dir = BLI_get_folder_create(BLENDER_USER_CONFIG, NULL); + if(!user_config_dir) + return; + + BLI_make_file_string("/", name, user_config_dir, BLENDER_HISTORY_FILE); recent = G.recent_files.first; /* refresh recent-files.txt of recent opened files, when current file was changed */ |