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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenfont/intern/blf_dir.c')
-rw-r--r--source/blender/blenfont/intern/blf_dir.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c
index 1eb7597fa54..6bee7b38537 100644
--- a/source/blender/blenfont/intern/blf_dir.c
+++ b/source/blender/blenfont/intern/blf_dir.c
@@ -125,20 +125,16 @@ char *blf_dir_search(const char *file)
{
DirBLF *dir;
char full_path[FILE_MAXDIR+FILE_MAXFILE];
- char *s;
-
- dir= global_font_dir.first;
- s= NULL;
- while (dir) {
- BLI_join_dirfile(full_path, dir->path, file);
+ char *s= NULL;
+
+ for(dir=global_font_dir.first; dir; dir= dir->next) {
+ BLI_join_dirfile(full_path, sizeof(full_path), dir->path, file);
if (BLI_exist(full_path)) {
- s= (char *)MEM_mallocN(strlen(full_path)+1,"blf_dir_search");
- strcpy(s, full_path);
+ s= BLI_strdup(full_path);
break;
}
- dir= dir->next;
}
-
+
if (!s) {
/* check the current directory, why not ? */
if (BLI_exist(file))