diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 16:10:33 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-05 17:33:46 +0300 |
commit | 481cdb08ed6f33a09d0e6843d1024db93c301178 (patch) | |
tree | 77166d130bfff2d5dca884676aaeff6bc0758f96 /source/blender/editors/space_file/file_draw.c | |
parent | 1d97e948d2c4867306e7fb5ce5fccf8b72c13391 (diff) |
Cleanup: use new accessors to blendfile path (Main.name).
Diffstat (limited to 'source/blender/editors/space_file/file_draw.c')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index befdf6751ee..fd9a9ff9ab1 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -412,6 +412,7 @@ static void file_draw_preview( static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname) { + Main *bmain = CTX_data_main(C); char newname[FILE_MAX + 12]; char orgname[FILE_MAX + 12]; char filename[FILE_MAX + 12]; @@ -420,10 +421,11 @@ static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname) ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); - BLI_make_file_string(G.main->name, orgname, sfile->params->dir, oldname); + const char *blendfile_path = BKE_main_blendfile_path(bmain); + BLI_make_file_string(blendfile_path, orgname, sfile->params->dir, oldname); BLI_strncpy(filename, sfile->params->renameedit, sizeof(filename)); BLI_filename_make_safe(filename); - BLI_make_file_string(G.main->name, newname, sfile->params->dir, filename); + BLI_make_file_string(blendfile_path, newname, sfile->params->dir, filename); if (!STREQ(orgname, newname)) { if (!BLI_exists(newname)) { |