From: raster Date: Sun, 16 May 2010 17:11:38 +0000 (+0000) Subject: gaaaaah! fix buf - paths were "wrong" - thus matching failed. man i see some X-Git-Tag: 2.0_alpha~51^2~375 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c51a76100d5eadf2434cf0a03fdfa390b3269d7;p=framework%2Fuifw%2Fefreet.git gaaaaah! fix buf - paths were "wrong" - thus matching failed. man i see some expensive ops going on with lots of strcmping. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@48917 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/efreet_base.c b/src/lib/efreet_base.c index 0abaedb..79339c0 100644 --- a/src/lib/efreet_base.c +++ b/src/lib/efreet_base.c @@ -8,6 +8,9 @@ #include #include +#include +#include + #include "Efreet.h" #include "efreet_private.h" @@ -243,7 +246,16 @@ efreet_dirs_get(const char *key, const char *fallback) { *p = '\0'; if (!eina_list_search_unsorted(dirs, EINA_COMPARE_CB(strcmp), s)) - dirs = eina_list_append(dirs, (void *)eina_stringshare_add(s)); + { + // resolve path properly/fully to remove path//path2 to + // path/path2, path/./path2 to path/path2 etc. + char *ts = ecore_file_realpath(s); + if (ts) + { + dirs = eina_list_append(dirs, (void *)eina_stringshare_add(ts)); + free(ts); + } + } s = ++p; p = strchr(s, EFREET_PATH_SEP); diff --git a/src/lib/efreet_utils.c b/src/lib/efreet_utils.c index 8b6b96c..cb75990 100644 --- a/src/lib/efreet_utils.c +++ b/src/lib/efreet_utils.c @@ -108,7 +108,7 @@ efreet_util_path_in_default(const char *section, const char *path) char *dir; dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(), - section); + section); EINA_LIST_FREE(dirs, dir) { @@ -130,7 +130,7 @@ efreet_util_path_to_file_id(const char *path) const char *file_id; /* TODO: Check if searching in cache is fast enough */ - if (!path) return NULL; + if (!path) return NULL; file_id = eina_hash_find(file_id_by_desktop_path, path); if (file_id) return file_id;