summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/efreet/src/lib/Efreet_Mime.h2
-rw-r--r--legacy/efreet/src/lib/efreet_icon.c88
-rw-r--r--legacy/efreet/src/lib/efreet_icon.h4
-rw-r--r--legacy/efreet/src/lib/efreet_mime.c4
-rw-r--r--legacy/efreet/src/tests/compare/efreet_alloc.c3
-rw-r--r--legacy/efreet/src/tests/ef_icon_theme.c20
6 files changed, 61 insertions, 60 deletions
diff --git a/legacy/efreet/src/lib/Efreet_Mime.h b/legacy/efreet/src/lib/Efreet_Mime.h
index 3bab016..9258f73 100644
--- a/legacy/efreet/src/lib/Efreet_Mime.h
+++ b/legacy/efreet/src/lib/Efreet_Mime.h
@@ -52,7 +52,7 @@ EAPI const char *efreet_mime_globs_type_get(const char *file);
52EAPI const char *efreet_mime_special_type_get(const char *file); 52EAPI const char *efreet_mime_special_type_get(const char *file);
53EAPI const char *efreet_mime_fallback_type_get(const char *file); 53EAPI const char *efreet_mime_fallback_type_get(const char *file);
54 54
55EAPI char *efreet_mime_type_icon_get(const char *mime, const char *theme, 55EAPI const char *efreet_mime_type_icon_get(const char *mime, const char *theme,
56 unsigned int size); 56 unsigned int size);
57 57
58EAPI void efreet_mime_type_cache_clear(void); 58EAPI void efreet_mime_type_cache_clear(void);
diff --git a/legacy/efreet/src/lib/efreet_icon.c b/legacy/efreet/src/lib/efreet_icon.c
index 3530e22..c31427a 100644
--- a/legacy/efreet/src/lib/efreet_icon.c
+++ b/legacy/efreet/src/lib/efreet_icon.c
@@ -35,23 +35,23 @@ static char *efreet_icon_remove_extension(const char *icon);
35static Efreet_Icon_Theme *efreet_icon_find_theme_check(const char *theme_name); 35static Efreet_Icon_Theme *efreet_icon_find_theme_check(const char *theme_name);
36 36
37 37
38static char *efreet_icon_find_fallback(Efreet_Icon_Theme *theme, 38static const char *efreet_icon_find_fallback(Efreet_Icon_Theme *theme,
39 const char *icon, 39 const char *icon,
40 unsigned int size); 40 unsigned int size);
41static char *efreet_icon_list_find_fallback(Efreet_Icon_Theme *theme, 41static const char *efreet_icon_list_find_fallback(Efreet_Icon_Theme *theme,
42 Eina_List *icons, 42 Eina_List *icons,
43 unsigned int size); 43 unsigned int size);
44static char *efreet_icon_find_helper(Efreet_Icon_Theme *theme, 44static const char *efreet_icon_find_helper(Efreet_Icon_Theme *theme,
45 const char *icon, unsigned int size); 45 const char *icon, unsigned int size);
46static char *efreet_icon_list_find_helper(Efreet_Icon_Theme *theme, 46static const char *efreet_icon_list_find_helper(Efreet_Icon_Theme *theme,
47 Eina_List *icons, unsigned int size); 47 Eina_List *icons, unsigned int size);
48static char *efreet_icon_lookup_icon(Efreet_Icon_Theme *theme, 48static const char *efreet_icon_lookup_icon(Efreet_Icon_Theme *theme,
49 const char *icon_name, unsigned int size); 49 const char *icon_name, unsigned int size);
50static char *efreet_icon_fallback_icon(const char *icon_name); 50static const char *efreet_icon_fallback_icon(const char *icon_name);
51static char *efreet_icon_fallback_dir_scan(const char *dir, 51static const char *efreet_icon_fallback_dir_scan(const char *dir,
52 const char *icon_name); 52 const char *icon_name);
53 53
54static char *efreet_icon_lookup_directory(Efreet_Icon_Theme *theme, 54static const char *efreet_icon_lookup_directory(Efreet_Icon_Theme *theme,
55 Efreet_Icon_Theme_Directory *dir, 55 Efreet_Icon_Theme_Directory *dir,
56 const char *icon_name); 56 const char *icon_name);
57static double efreet_icon_directory_size_distance(Efreet_Icon_Theme_Directory *dir, 57static double efreet_icon_directory_size_distance(Efreet_Icon_Theme_Directory *dir,
@@ -62,7 +62,7 @@ static int efreet_icon_directory_size_match(Efreet_Icon_Theme_Directory *dir,
62static Efreet_Icon *efreet_icon_new(const char *path); 62static Efreet_Icon *efreet_icon_new(const char *path);
63static void efreet_icon_populate(Efreet_Icon *icon, const char *file); 63static void efreet_icon_populate(Efreet_Icon *icon, const char *file);
64 64
65static char *efreet_icon_lookup_directory_helper(Efreet_Icon_Theme_Directory *dir, 65static const char *efreet_icon_lookup_directory_helper(Efreet_Icon_Theme_Directory *dir,
66 const char *path, const char *icon_name); 66 const char *path, const char *icon_name);
67 67
68static Efreet_Icon_Theme *efreet_icon_theme_new(void); 68static Efreet_Icon_Theme *efreet_icon_theme_new(void);
@@ -85,7 +85,7 @@ static int efreet_icon_theme_cache_check_dir(Efreet_Icon_Theme *theme,
85 const char *dir); 85 const char *dir);
86 86
87static void efreet_icon_cache_free(Efreet_Icon_Cache *value); 87static void efreet_icon_cache_free(Efreet_Icon_Cache *value);
88static char *efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int size); 88static const char *efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int size);
89static void efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int size, const char *value); 89static void efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int size, const char *value);
90 90
91/** 91/**
@@ -348,10 +348,10 @@ efreet_icon_find_theme_check(const char *theme_name)
348 * @return Returns the path to the given icon or NULL if none found 348 * @return Returns the path to the given icon or NULL if none found
349 * @brief Retrives the path to the given icon. 349 * @brief Retrives the path to the given icon.
350 */ 350 */
351EAPI char * 351EAPI const char *
352efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int size) 352efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int size)
353{ 353{
354 char *value = NULL; 354 const char *value = NULL;
355 Efreet_Icon_Theme *theme; 355 Efreet_Icon_Theme *theme;
356 356
357 theme = efreet_icon_find_theme_check(theme_name); 357 theme = efreet_icon_find_theme_check(theme_name);
@@ -392,13 +392,13 @@ efreet_icon_path_find(const char *theme_name, const char *icon, unsigned int siz
392 * @note This function will search the given theme for all icons before falling 392 * @note This function will search the given theme for all icons before falling
393 * back. This is useful when searching for mimetype icons. 393 * back. This is useful when searching for mimetype icons.
394 */ 394 */
395EAPI char * 395EAPI const char *
396efreet_icon_list_find(const char *theme_name, Eina_List *icons, 396efreet_icon_list_find(const char *theme_name, Eina_List *icons,
397 unsigned int size) 397 unsigned int size)
398{ 398{
399 Eina_List *l; 399 Eina_List *l;
400 const char *icon = NULL; 400 const char *icon = NULL;
401 char *value = NULL; 401 const char *value = NULL;
402 char *data; 402 char *data;
403 Efreet_Icon_Theme *theme; 403 Efreet_Icon_Theme *theme;
404 404
@@ -454,7 +454,7 @@ efreet_icon_list_find(const char *theme_name, Eina_List *icons,
454EAPI Efreet_Icon * 454EAPI Efreet_Icon *
455efreet_icon_find(const char *theme_name, const char *icon, unsigned int size) 455efreet_icon_find(const char *theme_name, const char *icon, unsigned int size)
456{ 456{
457 char *path; 457 const char *path;
458 458
459 path = efreet_icon_path_find(theme_name, icon, size); 459 path = efreet_icon_path_find(theme_name, icon, size);
460 if (path) 460 if (path)
@@ -462,7 +462,6 @@ efreet_icon_find(const char *theme_name, const char *icon, unsigned int size)
462 Efreet_Icon *ic; 462 Efreet_Icon *ic;
463 463
464 ic = efreet_icon_new(path); 464 ic = efreet_icon_new(path);
465 free(path);
466 return ic; 465 return ic;
467 } 466 }
468 467
@@ -478,13 +477,13 @@ efreet_icon_find(const char *theme_name, const char *icon, unsigned int size)
478 * icon found 477 * icon found
479 * @brief Scans inheriting themes for the given icon 478 * @brief Scans inheriting themes for the given icon
480 */ 479 */
481static char * 480static const char *
482efreet_icon_find_fallback(Efreet_Icon_Theme *theme, 481efreet_icon_find_fallback(Efreet_Icon_Theme *theme,
483 const char *icon, unsigned int size) 482 const char *icon, unsigned int size)
484{ 483{
485 Eina_List *l; 484 Eina_List *l;
486 char *parent = NULL; 485 const char *parent = NULL;
487 char *value = NULL; 486 const char *value = NULL;
488 487
489 if (theme->inherits) 488 if (theme->inherits)
490 { 489 {
@@ -522,11 +521,11 @@ efreet_icon_find_fallback(Efreet_Icon_Theme *theme,
522 * icon found 521 * icon found
523 * @brief Scans the theme and any inheriting themes for the given icon 522 * @brief Scans the theme and any inheriting themes for the given icon
524 */ 523 */
525static char * 524static const char *
526efreet_icon_find_helper(Efreet_Icon_Theme *theme, 525efreet_icon_find_helper(Efreet_Icon_Theme *theme,
527 const char *icon, unsigned int size) 526 const char *icon, unsigned int size)
528{ 527{
529 char *value; 528 const char *value;
530 static int recurse = 0; 529 static int recurse = 0;
531 530
532 efreet_icon_theme_cache_check(theme); 531 efreet_icon_theme_cache_check(theme);
@@ -559,13 +558,13 @@ efreet_icon_find_helper(Efreet_Icon_Theme *theme,
559 * icon found 558 * icon found
560 * @brief Scans inheriting themes for the given icons 559 * @brief Scans inheriting themes for the given icons
561 */ 560 */
562static char * 561static const char *
563efreet_icon_list_find_fallback(Efreet_Icon_Theme *theme, 562efreet_icon_list_find_fallback(Efreet_Icon_Theme *theme,
564 Eina_List *icons, unsigned int size) 563 Eina_List *icons, unsigned int size)
565{ 564{
566 Eina_List *l; 565 Eina_List *l;
567 char *parent = NULL; 566 const char *parent = NULL;
568 char *value = NULL; 567 const char *value = NULL;
569 568
570 if (theme->inherits) 569 if (theme->inherits)
571 { 570 {
@@ -607,12 +606,12 @@ efreet_icon_list_find_fallback(Efreet_Icon_Theme *theme,
607 * icon found 606 * icon found
608 * @brief Scans the theme and any inheriting themes for the given icons 607 * @brief Scans the theme and any inheriting themes for the given icons
609 */ 608 */
610static char * 609static const char *
611efreet_icon_list_find_helper(Efreet_Icon_Theme *theme, 610efreet_icon_list_find_helper(Efreet_Icon_Theme *theme,
612 Eina_List *icons, unsigned int size) 611 Eina_List *icons, unsigned int size)
613{ 612{
614 Eina_List *l; 613 Eina_List *l;
615 char *value = NULL; 614 const char *value = NULL;
616 const char *icon = NULL; 615 const char *icon = NULL;
617 static int recurse = 0; 616 static int recurse = 0;
618 617
@@ -649,12 +648,12 @@ efreet_icon_list_find_helper(Efreet_Icon_Theme *theme,
649 * none found 648 * none found
650 * @brief Looks for the @a icon in the @a theme for the @a size given. 649 * @brief Looks for the @a icon in the @a theme for the @a size given.
651 */ 650 */
652static char * 651static const char *
653efreet_icon_lookup_icon(Efreet_Icon_Theme *theme, const char *icon_name, 652efreet_icon_lookup_icon(Efreet_Icon_Theme *theme, const char *icon_name,
654 unsigned int size) 653 unsigned int size)
655{ 654{
656 Eina_List *l; 655 Eina_List *l;
657 char *icon = NULL, *tmp = NULL; 656 const char *icon = NULL, *tmp = NULL;
658 Efreet_Icon_Theme_Directory *dir; 657 Efreet_Icon_Theme_Directory *dir;
659 double minimal_distance = INT_MAX; 658 double minimal_distance = INT_MAX;
660 unsigned int ret_size = 0; 659 unsigned int ret_size = 0;
@@ -692,7 +691,6 @@ efreet_icon_lookup_icon(Efreet_Icon_Theme *theme, const char *icon_name,
692 icon_name); 691 icon_name);
693 if (tmp) 692 if (tmp)
694 { 693 {
695 FREE(icon);
696 icon = tmp; 694 icon = tmp;
697 minimal_distance = distance; 695 minimal_distance = distance;
698 ret_size = size; 696 ret_size = size;
@@ -713,13 +711,13 @@ efreet_icon_lookup_icon(Efreet_Icon_Theme *theme, const char *icon_name,
713 * none found 711 * none found
714 * @brief Tries to find the file closest matching the given icon 712 * @brief Tries to find the file closest matching the given icon
715 */ 713 */
716static char * 714static const char *
717efreet_icon_lookup_directory(Efreet_Icon_Theme *theme, 715efreet_icon_lookup_directory(Efreet_Icon_Theme *theme,
718 Efreet_Icon_Theme_Directory *dir, 716 Efreet_Icon_Theme_Directory *dir,
719 const char *icon_name) 717 const char *icon_name)
720{ 718{
721 Eina_List *l; 719 Eina_List *l;
722 char *icon = NULL; 720 const char *icon = NULL;
723 const char *path; 721 const char *path;
724 const char *tmp; 722 const char *tmp;
725 723
@@ -797,10 +795,10 @@ efreet_icon_directory_size_distance(Efreet_Icon_Theme_Directory *dir,
797 * @return Returns the Efreet_Icon for the given name or NULL if none found 795 * @return Returns the Efreet_Icon for the given name or NULL if none found
798 * @brief Looks for the un-themed icon in the base directories 796 * @brief Looks for the un-themed icon in the base directories
799 */ 797 */
800static char * 798static const char *
801efreet_icon_fallback_icon(const char *icon_name) 799efreet_icon_fallback_icon(const char *icon_name)
802{ 800{
803 char *icon; 801 const char *icon;
804 802
805 if (!icon_name) return NULL; 803 if (!icon_name) return NULL;
806 icon = efreet_icon_cache_check(NULL, icon_name, 0); 804 icon = efreet_icon_cache_check(NULL, icon_name, 0);
@@ -830,7 +828,7 @@ efreet_icon_fallback_icon(const char *icon_name)
830 EINA_LIST_FOREACH(xdg_dirs, l, dir) 828 EINA_LIST_FOREACH(xdg_dirs, l, dir)
831 { 829 {
832 snprintf(path, sizeof(path), "%s/icons", dir); 830 snprintf(path, sizeof(path), "%s/icons", dir);
833 icon = efreet_icon_fallback_dir_scan(path, icon_name); 831 efreet_icon_fallback_dir_scan(path, icon_name);
834 if (icon) 832 if (icon)
835 { 833 {
836 efreet_icon_cache_add(NULL, icon_name, 0, icon); 834 efreet_icon_cache_add(NULL, icon_name, 0, icon);
@@ -875,11 +873,11 @@ efreet_icon_fallback_icon(const char *icon_name)
875 * @brief Scans the given @a dir for the given @a icon_name returning the 873 * @brief Scans the given @a dir for the given @a icon_name returning the
876 * Efreet_icon if found, NULL otherwise. 874 * Efreet_icon if found, NULL otherwise.
877 */ 875 */
878static char * 876static const char *
879efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name) 877efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name)
880{ 878{
881 Eina_List *l; 879 Eina_List *l;
882 char *icon = NULL; 880 const char *icon = NULL;
883 char path[PATH_MAX], *ext; 881 char path[PATH_MAX], *ext;
884 const char *icon_path[] = { dir, "/", icon_name, NULL }; 882 const char *icon_path[] = { dir, "/", icon_name, NULL };
885 size_t size; 883 size_t size;
@@ -893,7 +891,7 @@ efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name)
893 891
894 if (ecore_file_exists(path)) 892 if (ecore_file_exists(path))
895 { 893 {
896 icon = strdup(path); 894 icon = eina_stringshare_add(path);
897 if (icon) break; 895 if (icon) break;
898 } 896 }
899 *(path + size) = '\0'; 897 *(path + size) = '\0';
@@ -904,7 +902,7 @@ efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name)
904 { 902 {
905 if ((ecore_file_exists(path)) && (!ecore_file_is_dir(path))) 903 if ((ecore_file_exists(path)) && (!ecore_file_is_dir(path)))
906 { 904 {
907 icon = strdup(path); 905 icon = eina_stringshare_add(path);
908#ifdef STRICT_SPEC 906#ifdef STRICT_SPEC
909 if (icon) 907 if (icon)
910 WRN("[Efreet]: Found an icon that already has an extension: %s", path); 908 WRN("[Efreet]: Found an icon that already has an extension: %s", path);
@@ -925,12 +923,12 @@ efreet_icon_fallback_dir_scan(const char *dir, const char *icon_name)
925 * @brief Caches the icons in the given theme directory path at the given 923 * @brief Caches the icons in the given theme directory path at the given
926 * size 924 * size
927 */ 925 */
928static char * 926static const char *
929efreet_icon_lookup_directory_helper(Efreet_Icon_Theme_Directory *dir, 927efreet_icon_lookup_directory_helper(Efreet_Icon_Theme_Directory *dir,
930 const char *path, const char *icon_name) 928 const char *path, const char *icon_name)
931{ 929{
932 Eina_List *l; 930 Eina_List *l;
933 char *icon = NULL; 931 const char *icon = NULL;
934 char file_path[PATH_MAX]; 932 char file_path[PATH_MAX];
935 const char *ext; 933 const char *ext;
936 size_t len; 934 size_t len;
@@ -951,7 +949,7 @@ efreet_icon_lookup_directory_helper(Efreet_Icon_Theme_Directory *dir,
951 949
952 if (ecore_file_exists(file_path)) 950 if (ecore_file_exists(file_path))
953 { 951 {
954 icon = strdup(file_path); 952 icon = eina_stringshare_add(file_path);
955 break; 953 break;
956 } 954 }
957 } 955 }
@@ -1603,7 +1601,7 @@ efreet_icon_cache_free(Efreet_Icon_Cache *value)
1603 free(value); 1601 free(value);
1604} 1602}
1605 1603
1606static char * 1604static const char *
1607efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int size) 1605efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int size)
1608{ 1606{
1609 Efreet_Icon_Cache *cache; 1607 Efreet_Icon_Cache *cache;
@@ -1621,7 +1619,7 @@ efreet_icon_cache_check(Efreet_Icon_Theme *theme, const char *icon, unsigned int
1621 if (!cache->path) 1619 if (!cache->path)
1622 return NON_EXISTING; 1620 return NON_EXISTING;
1623 else if (!stat(cache->path, &st) && st.st_mtime == cache->lasttime) 1621 else if (!stat(cache->path, &st) && st.st_mtime == cache->lasttime)
1624 return strdup(cache->path); 1622 return cache->path;
1625 eina_hash_del_by_key(efreet_icon_cache, key); 1623 eina_hash_del_by_key(efreet_icon_cache, key);
1626 } 1624 }
1627 return NULL; 1625 return NULL;
@@ -1643,7 +1641,7 @@ efreet_icon_cache_add(Efreet_Icon_Theme *theme, const char *icon, unsigned int s
1643 1641
1644 if ((value) && !stat(value, &st)) 1642 if ((value) && !stat(value, &st))
1645 { 1643 {
1646 cache->path = eina_stringshare_add(value); 1644 cache->path = value;
1647 cache->lasttime = st.st_mtime; 1645 cache->lasttime = st.st_mtime;
1648 } 1646 }
1649 else 1647 else
diff --git a/legacy/efreet/src/lib/efreet_icon.h b/legacy/efreet/src/lib/efreet_icon.h
index 2ed4f74..31bef00 100644
--- a/legacy/efreet/src/lib/efreet_icon.h
+++ b/legacy/efreet/src/lib/efreet_icon.h
@@ -150,10 +150,10 @@ EAPI Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name);
150EAPI Efreet_Icon *efreet_icon_find(const char *theme_name, 150EAPI Efreet_Icon *efreet_icon_find(const char *theme_name,
151 const char *icon, 151 const char *icon,
152 unsigned int size); 152 unsigned int size);
153EAPI char *efreet_icon_list_find(const char *theme_name, 153EAPI const char *efreet_icon_list_find(const char *theme_name,
154 Eina_List *icons, 154 Eina_List *icons,
155 unsigned int size); 155 unsigned int size);
156EAPI char *efreet_icon_path_find(const char *theme_name, 156EAPI const char *efreet_icon_path_find(const char *theme_name,
157 const char *icon, 157 const char *icon,
158 unsigned int size); 158 unsigned int size);
159EAPI void efreet_icon_free(Efreet_Icon *icon); 159EAPI void efreet_icon_free(Efreet_Icon *icon);
diff --git a/legacy/efreet/src/lib/efreet_mime.c b/legacy/efreet/src/lib/efreet_mime.c
index 50a69a1..a5cd63f 100644
--- a/legacy/efreet/src/lib/efreet_mime.c
+++ b/legacy/efreet/src/lib/efreet_mime.c
@@ -330,10 +330,10 @@ efreet_mime_type_get(const char *file)
330 * @return Returns mime type icon path as a string 330 * @return Returns mime type icon path as a string
331 * @brief Retreive the mime type icon for a file 331 * @brief Retreive the mime type icon for a file
332 */ 332 */
333EAPI char * 333EAPI const char *
334efreet_mime_type_icon_get(const char *mime, const char *theme, unsigned int size) 334efreet_mime_type_icon_get(const char *mime, const char *theme, unsigned int size)
335{ 335{
336 char *icon = NULL; 336 const char *icon = NULL;
337 char *data; 337 char *data;
338 Eina_List *icons = NULL; 338 Eina_List *icons = NULL;
339 const char *env = NULL; 339 const char *env = NULL;
diff --git a/legacy/efreet/src/tests/compare/efreet_alloc.c b/legacy/efreet/src/tests/compare/efreet_alloc.c
index a6582e1..65b0c88 100644
--- a/legacy/efreet/src/tests/compare/efreet_alloc.c
+++ b/legacy/efreet/src/tests/compare/efreet_alloc.c
@@ -7,7 +7,7 @@ int
7main(void) 7main(void)
8{ 8{
9 int i = 0, k; 9 int i = 0, k;
10 char *path; 10 const char *path;
11 11
12 efreet_init(); 12 efreet_init();
13 13
@@ -17,7 +17,6 @@ main(void)
17 { 17 {
18 path = efreet_icon_path_find(THEME, icons[i], SIZE); 18 path = efreet_icon_path_find(THEME, icons[i], SIZE);
19// printf("%s: %s\n", icons[i], (path ? path : "NOT FOUND")); 19// printf("%s: %s\n", icons[i], (path ? path : "NOT FOUND"));
20 if (path) free(path);
21 } 20 }
22 } 21 }
23 22
diff --git a/legacy/efreet/src/tests/ef_icon_theme.c b/legacy/efreet/src/tests/ef_icon_theme.c
index bb66698..d40a2c4 100644
--- a/legacy/efreet/src/tests/ef_icon_theme.c
+++ b/legacy/efreet/src/tests/ef_icon_theme.c
@@ -480,7 +480,8 @@ ef_cb_efreet_icon_match(void)
480 double start = ecore_time_get(); 480 double start = ecore_time_get();
481 for (i = 0; system_icons[i]; i++) 481 for (i = 0; system_icons[i]; i++)
482 { 482 {
483 char *path, *s; 483 const char *path;
484 char *p, *s;
484 485
485 path = efreet_icon_path_find(THEME, system_icons[i], SIZE); 486 path = efreet_icon_path_find(THEME, system_icons[i], SIZE);
486 487
@@ -500,9 +501,10 @@ ef_cb_efreet_icon_match(void)
500 printf("Found icon not in hash: %s\n", system_icons[i]); 501 printf("Found icon not in hash: %s\n", system_icons[i]);
501 } 502 }
502 503
503 s = strrchr(path, '.'); 504 p = strdup(path);
505 s = strrchr(p, '.');
504 if (s) *s = '\0'; 506 if (s) *s = '\0';
505 s = strrchr(path, '/'); 507 s = strrchr(p, '/');
506 if (s) s++; 508 if (s) s++;
507 509
508 if (s && strcmp(s, system_icons[i])) 510 if (s && strcmp(s, system_icons[i]))
@@ -510,7 +512,7 @@ ef_cb_efreet_icon_match(void)
510 printf("Name mismatch name (%s) vs ef (%s)\n", system_icons[i], s); 512 printf("Name mismatch name (%s) vs ef (%s)\n", system_icons[i], s);
511 ret = 0; 513 ret = 0;
512 } 514 }
513 free(path); 515 free(p);
514 } 516 }
515 printf("Time: %f\n", (ecore_time_get() - start)); 517 printf("Time: %f\n", (ecore_time_get() - start));
516 eina_hash_free(icon_hash); 518 eina_hash_free(icon_hash);
@@ -518,15 +520,17 @@ ef_cb_efreet_icon_match(void)
518 start = ecore_time_get(); 520 start = ecore_time_get();
519 for (i = 0; system_icons[i]; i++) 521 for (i = 0; system_icons[i]; i++)
520 { 522 {
521 char *path, *s; 523 const char *path;
524 char *p, *s;
522 525
523 path = efreet_icon_path_find(THEME, system_icons[i], SIZE); 526 path = efreet_icon_path_find(THEME, system_icons[i], SIZE);
524 527
525 if (!path) continue; 528 if (!path) continue;
529 p = strdup(path);
526 530
527 s = strrchr(path, '.'); 531 s = strrchr(p, '.');
528 if (s) *s = '\0'; 532 if (s) *s = '\0';
529 s = strrchr(path, '/'); 533 s = strrchr(p, '/');
530 if (s) s++; 534 if (s) s++;
531 535
532 if (s && strcmp(s, system_icons[i])) 536 if (s && strcmp(s, system_icons[i]))
@@ -534,7 +538,7 @@ ef_cb_efreet_icon_match(void)
534 printf("Name mismatch name (%s) vs ef (%s)\n", system_icons[i], s); 538 printf("Name mismatch name (%s) vs ef (%s)\n", system_icons[i], s);
535 ret = 0; 539 ret = 0;
536 } 540 }
537 free(path); 541 free(p);
538 } 542 }
539 printf("Time: %f\n", (ecore_time_get() - start)); 543 printf("Time: %f\n", (ecore_time_get() - start));
540 544