Bugfix #4343
authorTon Roosendaal <ton@blender.org>
Fri, 16 Jun 2006 12:17:35 +0000 (12:17 +0000)
committerTon Roosendaal <ton@blender.org>
Fri, 16 Jun 2006 12:17:35 +0000 (12:17 +0000)
The (SHIFT+F4) databrowser showed the library file (added some months
ago) which didn't work for extremely long directory names well.
I've recoded it, so it now only shows the .blend name, not entire path.

source/blender/src/filesel.c

index 3afb9f635e8526b16055f203a7d218ca5ea53ca9..cb478bf9f59c06caefbb8835bea048c83b4ece15 100644 (file)
@@ -2552,8 +2552,11 @@ void main_to_filelist(SpaceFile *sfile)
                                        if(id->lib==NULL)
                                                files->relname= BLI_strdup(id->name+2);
                                        else {
-                                               files->relname= MEM_mallocN(FILE_MAXDIR+FILE_MAXFILE+32, "filename for lib");
-                                               sprintf(files->relname, "%s | %s", id->lib->name, id->name+2);
+                                               char tmp[FILE_MAXDIR+FILE_MAXFILE], fi[FILE_MAXFILE];
+                                               BLI_strncpy(tmp, id->lib->name, FILE_MAXDIR+FILE_MAXFILE);
+                                               BLI_splitdirstring(tmp, fi);
+                                               files->relname= MEM_mallocN(FILE_MAXFILE+32, "filename for lib");
+                                               sprintf(files->relname, "%s / %s", fi, id->name+2);
                                        }
                                        
                                        if(sfile->returnfunc==0) { /* F4 DATA BROWSE */