aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore_file/ecore_file.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2010-01-18 11:05:03 +0000
committerCedric BAIL <cedric.bail@free.fr>2010-01-18 11:05:03 +0000
commit3d2b34c85c393136770b4962a8b5a3e383d3f2a9 (patch)
treeb660dbbecd7c7e74bd1162a76d3d034ecdd44a5c /legacy/ecore/src/lib/ecore_file/ecore_file.c
parentmap source api - nothing implemented. for future expansion. (diff)
downloadefl-3d2b34c85c393136770b4962a8b5a3e383d3f2a9.tar.gz
* ecore: Fix ecore_file_dir_get.
SVN revision: 45283
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_file/ecore_file.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c
index 9c811a36d4..1bfcaee111 100644
--- a/legacy/ecore/src/lib/ecore_file/ecore_file.c
+++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c
@@ -13,6 +13,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <dirent.h>
+#include <libgen.h>
#ifndef _FILE_OFFSET_BITS
# define _FILE_OFFSET_BITS 64
@@ -600,13 +601,8 @@ ecore_file_dir_get(const char *file)
char buf[PATH_MAX];
strncpy(buf, file, PATH_MAX);
- p = strrchr(buf, '/');
- if (!p) return strdup(file);
-
- if (p == buf) return strdup("/");
-
- *p = 0;
- return strdup(buf);
+ p = dirname(buf);
+ return strdup(p);
}
/**