Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/ecore

Dir     : e17/libs/ecore/src/lib/ecore_file


Modified Files:
        ecore_file.c 


Log Message:


do not follow the white rabbit... err - i mean symlink! respect the symlinks
dude! on recursive rm... respect!

===================================================================
RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- ecore_file.c        20 Jan 2006 09:13:19 -0000      1.45
+++ ecore_file.c        31 Aug 2006 05:12:54 -0000      1.46
@@ -121,7 +121,7 @@
      {
        if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, "..")))
          {
-            char path[PATH_MAX];
+            char path[PATH_MAX], buf[PATH_MAX];;
             struct stat st;
 
             snprintf(path, PATH_MAX, "%s/%s", dir, dp->d_name);
@@ -131,12 +131,13 @@
                  continue;
               }
 
-            if (S_ISDIR(st.st_mode))
+            if ((S_ISDIR(st.st_mode) &&
+                 (readlink(path, buf, sizeof(buf)) <= 0)))
               {
                  ecore_file_recursive_rm(path);
                  ecore_file_rmdir(path);
               }
-            else if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode))
+            else
               {
                  ecore_file_unlink(path);
               }



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to