[Bf-committers] Fix bug: 1013
Kenneth Styrberg
bf-committers@blender.org
Sun, 4 Apr 2004 23:21:39 +0200
Here's a fix for bug 1013. This prevents appending from current/active =
file (SHIFT+f1), and fixes the breakage on version backups (CTRL+w). =
Tested on W98SE.
//styken
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/bf-blender/blender/source/blender/src/filesel.c,v
retrieving revision 1.32
diff -u -r1.32 filesel.c
--- filesel.c 2 Mar 2004 16:49:50 -0000 1.32
+++ filesel.c 4 Apr 2004 21:20:01 -0000
@@ -2236,6 +2236,7 @@
} else if (group[0]=3D=3D0) {
error("Nothing indicated");
} else if (BLI_streq(G.main->name, dir)) {
+ strcpy(G.lib, dir);
error("Cannot use current file as library");
} else {
Object *ob;
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: =
/cvsroot/bf-blender/blender/source/blender/blenloader/intern/readfile.c,v=
retrieving revision 1.44
diff -u -r1.44 readfile.c
--- readfile.c 20 Mar 2004 22:55:38 -0000 1.44
+++ readfile.c 4 Apr 2004 21:15:13 -0000
@@ -785,7 +785,7 @@
{
int file=3D open(name, O_BINARY|O_RDONLY);
=20
- if (file =3D=3D -1) {
+ if (file < 0) {
return NULL;
} else {
FileData *fd =3D filedata_new();
@@ -804,7 +804,7 @@
blo_freefiledata(fd);
fd=3D NULL;
}
-
+ close(file);
return fd;
}
}