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
path: root/source
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2005-10-26 00:19:31 +0400
committerAndrea Weikert <elubie@gmx.net>2005-10-26 00:19:31 +0400
commitded4709a9d116a7e9ad1a91937e445154474118d (patch)
tree1163f819d2f77e82b8085c05a5c2b9c87f4e79f3 /source
parent129097a0971a2df28f1b8a386622a6347e14235c (diff)
FIX: BLI_makestringcode called with bad pointer mainl->curlib
Moved call to before blo_join_main where pointer gets killed. Otherwise Blender crashed when appending a file and selecting relative filenames.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 84ac4bae323..77d041d8be7 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5875,6 +5875,13 @@ void BLO_library_append(SpaceFile *sfile, char *dir, int idcode)
/* do this when expand found other libs */
read_libraries(fd, &fd->mainlist);
+ if(sfile->flag & FILE_STRINGCODE) {
+ /* uses old .blend file (*filename) as reference */
+ BLI_makestringcode(filename, mainl->curlib->name);
+ /* the caller checks for appended library, so we make sure names match */
+ BLI_strncpy(dir, mainl->curlib->name, sizeof(mainl->curlib->name));
+ }
+
blo_join_main(&fd->mainlist);
G.main= fd->mainlist.first;
@@ -5890,14 +5897,7 @@ void BLO_library_append(SpaceFile *sfile, char *dir, int idcode)
if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
blo_freefiledata((FileData*) sfile->libfiledata);
sfile->libfiledata= 0;
- }
-
- if(sfile->flag & FILE_STRINGCODE) {
- /* uses old .blend file (*filename) as reference */
- BLI_makestringcode(filename, mainl->curlib->name);
- /* the caller checks for appended library, so we make sure names match */
- BLI_strncpy(dir, mainl->curlib->name, sizeof(mainl->curlib->name));
- }
+ }
if(sfile->flag & FILE_ATCURSOR) {
centerbase= (G.scene->base.first);