diff options
author | Cedric BAIL <cedric.bail@free.fr> | 2010-01-18 11:05:03 +0000 |
---|---|---|
committer | Cedric BAIL <cedric.bail@free.fr> | 2010-01-18 11:05:03 +0000 |
commit | 3d2b34c85c393136770b4962a8b5a3e383d3f2a9 (patch) | |
tree | b660dbbecd7c7e74bd1162a76d3d034ecdd44a5c /legacy/ecore/src/lib/ecore_file/ecore_file.c | |
parent | 6fab52157f973e9f61a2f0a9fcbeaa18b3a10dcd (diff) |
* ecore: Fix ecore_file_dir_get.
SVN revision: 45283
Diffstat (limited to '')
-rw-r--r-- | legacy/ecore/src/lib/ecore_file/ecore_file.c | 10 |
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 @@ | |||
13 | #include <sys/stat.h> | 13 | #include <sys/stat.h> |
14 | #include <unistd.h> | 14 | #include <unistd.h> |
15 | #include <dirent.h> | 15 | #include <dirent.h> |
16 | #include <libgen.h> | ||
16 | 17 | ||
17 | #ifndef _FILE_OFFSET_BITS | 18 | #ifndef _FILE_OFFSET_BITS |
18 | # define _FILE_OFFSET_BITS 64 | 19 | # define _FILE_OFFSET_BITS 64 |
@@ -600,13 +601,8 @@ ecore_file_dir_get(const char *file) | |||
600 | char buf[PATH_MAX]; | 601 | char buf[PATH_MAX]; |
601 | 602 | ||
602 | strncpy(buf, file, PATH_MAX); | 603 | strncpy(buf, file, PATH_MAX); |
603 | p = strrchr(buf, '/'); | 604 | p = dirname(buf); |
604 | if (!p) return strdup(file); | 605 | return strdup(p); |
605 | |||
606 | if (p == buf) return strdup("/"); | ||
607 | |||
608 | *p = 0; | ||
609 | return strdup(buf); | ||
610 | } | 606 | } |
611 | 607 | ||
612 | /** | 608 | /** |