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:
authorTon Roosendaal <ton@blender.org>2004-04-05 15:25:25 +0400
committerTon Roosendaal <ton@blender.org>2004-04-05 15:25:25 +0400
commitbcb7e33813e0ff76c7744ed80b0a6ae53c518e8f (patch)
tree8b185be4d4a30e51e3e2eb6522c05d9c908fa329 /source
parent381605be7d517139faa27f5dc7413e6bbfe4cf52 (diff)
- bugfix #1013
When you try to SHIFT+F1 Link a file, but accidentally choose the current file, the error handling didn't immediately close the file. That can give problems with saving over with CTRL+W. Fix is that filesel.c now prevents selecting the current file.
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/filesel.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/src/filesel.c b/source/blender/src/filesel.c
index 751fed5d435..0bc79c84ef7 100644
--- a/source/blender/src/filesel.c
+++ b/source/blender/src/filesel.c
@@ -505,14 +505,18 @@ void test_flags_file(SpaceFile *sfile)
if(sfile->type==FILE_BLENDER || sfile->type==FILE_LOADLIB) {
if(BLO_has_bfile_extension(file->relname)) {
file->flags |= BLENDERFILE;
+
if(sfile->type==FILE_LOADLIB) {
- file->type &= ~S_IFMT;
- file->type |= S_IFDIR;
+ char name[FILE_MAXDIR+FILE_MAXFILE];
+ strcpy(name, sfile->dir);
+ strcat(name, file->relname);
+ /* prevent current file being used as acceptable dir */
+ if (BLI_streq(G.main->name, name)==0) {
+ file->type &= ~S_IFMT;
+ file->type |= S_IFDIR;
+ }
}
}
- else if(BLI_testextensie(file->relname, ".psx")) {
- file->flags |= PSXFILE;
- }
} else if (sfile->type==FILE_SPECIAL){
if(BLI_testextensie(file->relname, ".py")) {
file->flags |= PYSCRIPTFILE;
@@ -2203,7 +2207,7 @@ static int is_a_library(SpaceFile *sfile, char *dir, char *group)
len= strlen(dir);
if(len<7) return 0;
if( dir[len-1] != '/' && dir[len-1] != '\\') return 0;
-
+
group[0]= 0;
dir[len-1]= 0;