Commit: a7c40eedd4a6ec86da529bd0c7cbc17bcf2ad7d4
Author: Campbell Barton
Date:   Tue Mar 21 10:15:13 2017 +1100
Branches: app-templates
https://developer.blender.org/rBa7c40eedd4a6ec86da529bd0c7cbc17bcf2ad7d4

Use blank string for default template

===================================================================

M       source/blender/windowmanager/intern/wm_files.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files.c 
b/source/blender/windowmanager/intern/wm_files.c
index f5ed8a8b03..c925f17249 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1483,15 +1483,23 @@ static int wm_homefile_read_exec(bContext *C, 
wmOperator *op)
                G.fileflags &= ~G_FILE_NO_UI;
        }
 
-       char app_template_buf[sizeof(U.app_template)] = "";
-       const char *app_template = NULL;
+       char app_template_buf[sizeof(U.app_template)];
+       const char *app_template;
        const bool is_app_template = !from_memory && RNA_boolean_get(op->ptr, 
"use_template");
        const bool use_splash = !from_memory && RNA_boolean_get(op->ptr, 
"use_splash");
 
-       if (is_app_template && filepath != NULL) {
-               wm_file_template_from_path(app_template_buf, filepath);
+       if (is_app_template) {
+               if (filepath != NULL) {
+                       wm_file_template_from_path(app_template_buf, filepath);
+               }
+               else {
+                       app_template_buf[0] = '\0';
+               }
                app_template = app_template_buf;
        }
+       else {
+               app_template = NULL;
+       }
 
        if (wm_homefile_read(C, op->reports, from_memory, filepath, 
app_template)) {
                if (use_splash) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to