Enlightenment CVS committal

Author  : sebastid
Project : e17
Module  : libs/ecore

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


Modified Files:
        ecore_file.c 


Log Message:
ecore_file_mkpath:
- do the right checks.

===================================================================
RCS file: 
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ecore_file.c        28 Apr 2005 21:53:36 -0000      1.7
+++ ecore_file.c        4 May 2005 07:15:26 -0000       1.8
@@ -75,25 +75,26 @@
 ecore_file_mkpath(const char *path)
 {
    char ss[PATH_MAX];
-   int  i, ii;
+   int  i;
 
    ss[0] = 0;
    i = 0;
-   ii = 0;
    while (path[i])
      {
-       if (ii == sizeof(ss) - 1) return 0;
-       ss[ii++] = path[i];
-       ss[ii] = 0;
+       if (i == sizeof(ss) - 1) return 0;
+       ss[i] = path[i];
+       ss[i + 1] = 0;
        if (path[i] == '/')
          {
-            if (!ecore_file_is_dir(ss)) ecore_file_mkdir(ss);
-            else if (!ecore_file_is_dir(ss)) return 0;
+            ss[i] = 0;
+            if ((ecore_file_exists(ss)) && (!ecore_file_is_dir(ss))) return 0;
+            else if (!ecore_file_exists(ss)) ecore_file_mkdir(ss);
+            ss[i] = '/';
          }
        i++;
      }
-   if (!ecore_file_is_dir(ss)) ecore_file_mkdir(ss);
-   else if (!ecore_file_is_dir(ss)) return 0;
+   if ((ecore_file_exists(ss)) && (!ecore_file_is_dir(ss))) return 0;
+   else if (!ecore_file_exists(ss)) ecore_file_mkdir(ss);
    return 1;
 }
 




-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to