Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : libs/ecore

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


Modified Files:
        ecore_file.c 


Log Message:
Dont overrite ourselves and zero the file out during copy operations if src and 
dst are the same
===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- ecore_file.c        7 Oct 2005 17:48:09 -0000       1.29
+++ ecore_file.c        10 Oct 2005 16:25:17 -0000      1.30
@@ -125,8 +125,16 @@
 {
    FILE               *f1, *f2;
    char                buf[16384];
+   char                realpath1[PATH_MAX];
+   char                realpath2[PATH_MAX];
    size_t              num;
-
+   
+   if(realpath(src, realpath1) && realpath(src,realpath2))     
+     if(!strcmp(realpath1, realpath2))
+       return 0;
+   else
+     return 0;
+   
    f1 = fopen(src, "rb");
    if (!f1) return 0;
    f2 = fopen(dst, "wb");




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to