Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ecore

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


Modified Files:
        ecore_path.c 


Log Message:
Only check the stat results when the stat succeeded.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore/ecore_path.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- ecore_path.c        8 May 2004 04:44:04 -0000       1.3
+++ ecore_path.c        10 Jul 2004 23:14:02 -0000      1.4
@@ -137,6 +137,7 @@
 char *
 ecore_path_group_find(int group_id, char *name)
 {
+       int r;
        char *p;
        struct stat st;
        char path[PATH_MAX];
@@ -153,8 +154,9 @@
        p = ecore_list_next(group->paths);
        do {
                snprintf(path, PATH_MAX, "%s/%s", p, name);
-               stat(path, &st);
-       } while (!S_ISREG(st.st_mode) && (p = ecore_list_next(group->paths)));
+               r = stat(path, &st);
+       } while (((r < 0) || !S_ISREG(st.st_mode)) &&
+                       (p = ecore_list_next(group->paths)));
 
        if (p)
                p = strdup(path);




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to