Only check the stat results when the stat succeeded.
SVN revision: 10772
This commit is contained in:
parent
771ef088c0
commit
19236c6dc3
|
@ -137,6 +137,7 @@ ecore_path_group_remove(int group_id, char *path)
|
|||
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 @@ ecore_path_group_find(int group_id, char *name)
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue