Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-05 18:02:50 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-05 18:02:50 +0300
commitf0d9dbae0dae4deae84824833096c38e625073cb (patch)
treea9fa826eb5860e9b62d16c3498703bde1bb5d4aa /source/blender/editors/space_file/file_draw.c
parentce6db959c7d96792edad3a6d606e3662a4ef0798 (diff)
parent481cdb08ed6f33a09d0e6843d1024db93c301178 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/blenkernel/intern/blendfile.c source/blender/blenloader/intern/readfile.h source/blender/blenloader/intern/versioning_250.c source/blender/blenloader/intern/versioning_260.c source/blender/blenloader/intern/versioning_270.c source/blender/blenloader/intern/versioning_legacy.c source/blender/editors/render/render_shading.c source/blender/makesrna/intern/rna_movieclip.c source/blender/render/intern/source/pipeline.c source/blender/render/intern/source/voxeldata.c
Diffstat (limited to 'source/blender/editors/space_file/file_draw.c')
-rw-r--r--source/blender/editors/space_file/file_draw.c6
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 fcfe745546e..360009d3ea4 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -424,6 +424,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];
@@ -432,10 +433,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)) {