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;
|
struct stat st;
|
||||||
|
|
||||||
|
|
||||||
if (stat(dir, &st) == -1) return 0;
|
|
||||||
|
|
||||||
if (readlink(dir, buf, sizeof(buf)) > 0)
|
if (readlink(dir, buf, sizeof(buf)) > 0)
|
||||||
{
|
{
|
||||||
ecore_file_unlink(dir);
|
ecore_file_unlink(dir);
|
||||||
}
|
}
|
||||||
else if (S_ISDIR(st.st_mode))
|
else if (S_ISDIR(st.st_mode))
|
||||||
{
|
{
|
||||||
|
if (stat(dir, &st) == -1) return 0;
|
||||||
dirp = opendir(dir);
|
dirp = opendir(dir);
|
||||||
|
|
||||||
if (dirp)
|
if (dirp)
|
||||||
{
|
{
|
||||||
while ((dp = readdir(dirp)))
|
while ((dp = readdir(dirp)))
|
||||||
|
@ -138,6 +136,7 @@ ecore_file_recursive_rm(const char *dir)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (stat(dir, &st) == -1) return 0;
|
||||||
ecore_file_unlink(dir);
|
ecore_file_unlink(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue