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.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c
index 1eb7597fa54..857ead0b7cd 100644
--- a/source/blender/blenfont/intern/blf_dir.c
+++ b/source/blender/blenfont/intern/blf_dir.c
@@ -1,4 +1,4 @@
-/**
+/*
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -25,6 +25,11 @@
* ***** END GPL LICENSE BLOCK *****
*/
+/** \file blender/blenfont/intern/blf_dir.c
+ * \ingroup blf
+ */
+
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -44,6 +49,7 @@
#include "BIF_gl.h"
+#include "BLF_api.h"
#include "blf_internal_types.h"
static ListBase global_font_dir= { NULL, NULL };
@@ -54,7 +60,7 @@ static DirBLF *blf_dir_find(const char *path)
p= global_font_dir.first;
while (p) {
- if (!strcmp(p->path, path))
+ if (BLI_path_cmp(p->path, path) == 0)
return(p);
p= p->next;
}
@@ -125,20 +131,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))