#include <string.h>
#include <limits.h>
+#include <Ecore.h>
+#include <Ecore_File.h>
+
#include "Efreet.h"
#include "efreet_private.h"
{
*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);
char *dir;
dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
- section);
+ section);
EINA_LIST_FREE(dirs, dir)
{
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;