diff options
author | Ton Roosendaal <ton@blender.org> | 2005-06-02 21:38:42 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-06-02 21:38:42 +0400 |
commit | 7654d1a711d4802c53267c00f9432be902010871 (patch) | |
tree | 87f543eb067c848bff7c34ba54f4a2129dd8bd51 /source/blender/src/filesel.c | |
parent | 01d0b5eba83b938edc4b8af0af1ebd7cf3c78a2e (diff) |
Fix for #2657
Appending from files also set the string for "last loaded file". That's
a real bad one... so you can save over accidentally libraries.
Another fix: appending from files that have dynamic other files linked
with relative paths didn't work. (Yah, now it should all work!)
renderconverter change is just a more clear comment.
Diffstat (limited to 'source/blender/src/filesel.c')
-rw-r--r-- | source/blender/src/filesel.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c index d089e51bfcd..5e8d2e17b6f 100644 --- a/source/blender/src/filesel.c +++ b/source/blender/src/filesel.c @@ -2236,9 +2236,10 @@ static void do_library_append(SpaceFile *sfile) static void library_to_filelist(SpaceFile *sfile) { - char dir[FILE_MAXDIR], group[24]; - int ok, i, nnames, idcode; LinkNode *l, *names; + int ok, i, nnames, idcode; + char filename[FILE_MAXDIR+FILE_MAXFILE]; + char dir[FILE_MAXDIR], group[24]; /* name test */ ok= is_a_library(sfile, dir, group); @@ -2249,10 +2250,13 @@ static void library_to_filelist(SpaceFile *sfile) return; } + BLI_strncpy(filename, G.sce, sizeof(filename)); // G.sce = last file loaded, for UI + /* there we go */ /* for the time being only read filedata when libfiledata==0 */ if (sfile->libfiledata==0) { - sfile->libfiledata= BLO_blendhandle_from_file(dir); + sfile->libfiledata= BLO_blendhandle_from_file(dir); // this sets G.sce, we dont want it + if(sfile->libfiledata==0) return; } @@ -2295,6 +2299,9 @@ static void library_to_filelist(SpaceFile *sfile) if (len > sfile->maxnamelen) sfile->maxnamelen = len; } + + BLI_strncpy(G.sce, filename, sizeof(filename)); // prevent G.sce to change + } /* ******************* DATA SELECT ********************* */ |