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.
This commit is contained in:
Ton Roosendaal 2004-04-05 11:25:25 +00:00
parent 381605be7d
commit bcb7e33813

@ -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;