forked from enlightenment/efl
fix recursive rm to delete broken symlinks
SVN revision: 26609
This commit is contained in:
parent
88ce3a9252
commit
6abe8fae09
|
@ -112,16 +112,14 @@ ecore_file_recursive_rm(const char *dir)
|
|||
struct stat st;
|
||||
|
||||
|
||||
if (stat(dir, &st) == -1) return 0;
|
||||
|
||||
if (readlink(dir, buf, sizeof(buf)) > 0)
|
||||
{
|
||||
ecore_file_unlink(dir);
|
||||
}
|
||||
else if (S_ISDIR(st.st_mode))
|
||||
{
|
||||
if (stat(dir, &st) == -1) return 0;
|
||||
dirp = opendir(dir);
|
||||
|
||||
if (dirp)
|
||||
{
|
||||
while ((dp = readdir(dirp)))
|
||||
|
@ -138,6 +136,7 @@ ecore_file_recursive_rm(const char *dir)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (stat(dir, &st) == -1) return 0;
|
||||
ecore_file_unlink(dir);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue