efreet: check for subpath
authorenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 28 Feb 2011 10:50:16 +0000 (10:50 +0000)
committerenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 28 Feb 2011 10:50:16 +0000 (10:50 +0000)
Need to check if the path we want to add is a subpath of an already
added path.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@57407 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/efreet_cache.c

index 57127cd..a54dce6 100644 (file)
@@ -865,8 +865,7 @@ efreet_cache_desktop_add(Efreet_Desktop *desktop)
         for (i = 0; i < arr->array_count; i++)
         {
             /* Check if we already have this dir in cache */
-            /* TODO: Need to check if p is a subdir */
-            if (!strcmp(p, arr->array[i]))
+            if (!strncmp(p, arr->array[i], strlen(arr->array[i])))
                 return;
         }
     }