diff --git a/legacy/ecore/src/lib/ecore_file/Ecore_File.h b/legacy/ecore/src/lib/ecore_file/Ecore_File.h index e111f552bb..26bbc70b03 100644 --- a/legacy/ecore/src/lib/ecore_file/Ecore_File.h +++ b/legacy/ecore/src/lib/ecore_file/Ecore_File.h @@ -87,6 +87,7 @@ extern "C" { EAPI void ecore_file_monitor_del(Ecore_File_Monitor *ecore_file_monitor); EAPI const char *ecore_file_monitor_path_get(Ecore_File_Monitor *ecore_file_monitor); + EAPI int ecore_file_path_dir_exists(const char *in_dir); EAPI int ecore_file_app_installed(const char *exe); EAPI Ecore_List *ecore_file_app_list(void); diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_path.c b/legacy/ecore/src/lib/ecore_file/ecore_file_path.c index d1f634db18..844212bb73 100644 --- a/legacy/ecore/src/lib/ecore_file/ecore_file_path.c +++ b/legacy/ecore/src/lib/ecore_file/ecore_file_path.c @@ -46,7 +46,8 @@ _ecore_file_path_from_env(const char *env) if (!*p) { - ecore_list_append(path, strdup(last)); + if (!ecore_file_path_dir_exists(last)) + ecore_list_append(path, strdup(last)); last = p + 1; } } @@ -57,6 +58,19 @@ _ecore_file_path_from_env(const char *env) return path; } +EAPI int +ecore_file_path_dir_exists(const char *in_dir) +{ + char *dir; + + ecore_list_goto_first(__ecore_file_path_bin); + while ((dir = ecore_list_next(__ecore_file_path_bin)) != NULL) + { + if (!strcmp(dir, in_dir)) return 1; + } + return 0; +} + EAPI int ecore_file_app_installed(const char *exe) {