summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-10-15 08:00:31 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-10-15 08:00:31 +0000
commite1ada6ad4de9697034dd478dbe987f17aafdb51d (patch)
tree9375626427fbabe564976be27e68cfcf87881d6c
parent7de4d6b72aa8da049f3dd98ffa7a8005b3e60ae0 (diff)
oops - yes - windows. ugh. indeed.
SVN revision: 77985
-rw-r--r--legacy/ecore/AUTHORS1
-rw-r--r--legacy/ecore/src/lib/ecore_file/ecore_file.c24
2 files changed, 16 insertions, 9 deletions
diff --git a/legacy/ecore/AUTHORS b/legacy/ecore/AUTHORS
index 22a8974123..2de0ab8794 100644
--- a/legacy/ecore/AUTHORS
+++ b/legacy/ecore/AUTHORS
@@ -56,4 +56,3 @@ Seong-ho Cho (DarkCircle) <darkcircle.0426@gmail.com>
56Patryk Kaczmarek <patryk.k@samsung.com> 56Patryk Kaczmarek <patryk.k@samsung.com>
57Daniel Willmann <d.willmann@samsung.com> 57Daniel Willmann <d.willmann@samsung.com>
58Michal Pakula vel Rutka <m.pakula@samsung.com> 58Michal Pakula vel Rutka <m.pakula@samsung.com>
59Maxime Villard <rustyBSD@gmx.fr>
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c
index 3096506878..c59bf8054e 100644
--- a/legacy/ecore/src/lib/ecore_file/ecore_file.c
+++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c
@@ -399,16 +399,21 @@ ecore_file_remove(const char *file)
399EAPI Eina_Bool 399EAPI Eina_Bool
400ecore_file_recursive_rm(const char *dir) 400ecore_file_recursive_rm(const char *dir)
401{ 401{
402 Eina_Iterator *it;
403 char buf[PATH_MAX];
402 struct stat st; 404 struct stat st;
405 int ret;
403 406
404 if (lstat(dir, &st) == -1) 407 if (readlink(dir, buf, sizeof(buf) - 1) > 0)
405 return EINA_FALSE; 408 return ecore_file_unlink(dir);
406 409
407 if (S_ISDIR(st.st_mode)) 410 ret = stat(dir, &st);
411 if ((ret == 0) && (S_ISDIR(st.st_mode)))
408 { 412 {
409 Eina_File_Direct_Info *info; 413 Eina_File_Direct_Info *info;
410 Eina_Iterator *it; 414
411 int ret = 1; 415 ret = 1;
416 if (stat(dir, &st) == -1) return EINA_FALSE; /* WOOT: WHY ARE WE CALLING STAT TWO TIMES ??? */
412 417
413 it = eina_file_direct_ls(dir); 418 it = eina_file_direct_ls(dir);
414 EINA_ITERATOR_FOREACH(it, info) 419 EINA_ITERATOR_FOREACH(it, info)
@@ -424,8 +429,11 @@ ecore_file_recursive_rm(const char *dir)
424 else 429 else
425 return EINA_FALSE; 430 return EINA_FALSE;
426 } 431 }
427 432 else
428 return ecore_file_unlink(dir); 433 {
434 if (ret == -1) return EINA_FALSE;
435 return ecore_file_unlink(dir);
436 }
429} 437}
430 438
431static inline Eina_Bool 439static inline Eina_Bool
@@ -782,7 +790,7 @@ EAPI char *
782ecore_file_readlink(const char *lnk) 790ecore_file_readlink(const char *lnk)
783{ 791{
784 char buf[PATH_MAX]; 792 char buf[PATH_MAX];
785 ssize_t count; 793 int count;
786 794
787 if ((count = readlink(lnk, buf, sizeof(buf) - 1)) < 0) return NULL; 795 if ((count = readlink(lnk, buf, sizeof(buf) - 1)) < 0) return NULL;
788 buf[count] = 0; 796 buf[count] = 0;