summaryrefslogtreecommitdiff
path: root/src/bin/e_path.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-21 10:01:01 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-12-21 10:01:01 +0000
commite9ea6454d9076767c1b2e996325318d0cf1c301b (patch)
tree9a10a8b5e0d6e36fffb88bea83da39b57674084e /src/bin/e_path.c
parent4ee20a2c2f91d778218056acac667a855395a530 (diff)
downloadenlightenment-e9ea6454d9076767c1b2e996325318d0cf1c301b.tar.gz
some stringshare improvements for e_path_find
SVN revision: 81526
Diffstat (limited to 'src/bin/e_path.c')
-rw-r--r--src/bin/e_path.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/bin/e_path.c b/src/bin/e_path.c
index f4da0d2226..4d1dc64a1d 100644
--- a/src/bin/e_path.c
+++ b/src/bin/e_path.c
@@ -232,6 +232,7 @@ e_path_find(E_Path *ep, const char *file)
Eina_List *l;
E_Path_Dir *epd;
char *str;
+ Eina_Stringshare *ret;
char buf[PATH_MAX] = "";
E_OBJECT_CHECK_RETURN(ep, NULL);
@@ -239,7 +240,7 @@ e_path_find(E_Path *ep, const char *file)
if (!file) return NULL;
str = eina_hash_find(ep->hash, file);
- if (str) return eina_stringshare_add(str);
+ if (str) return eina_stringshare_ref(str);
/* Look in the default dir list */
EINA_LIST_FOREACH(ep->default_dir_list, l, epd)
{
@@ -252,9 +253,9 @@ e_path_find(E_Path *ep, const char *file)
ep->hash = eina_hash_string_superfast_new(NULL);
if (eina_hash_population(ep->hash) >= 512)
_e_path_cache_free(ep);
- eina_hash_add(ep->hash, file,
- eina_stringshare_add(buf));
- return eina_stringshare_add(buf);
+ ret = eina_stringshare_add(buf);
+ eina_hash_add(ep->hash, file, ret);
+ return eina_stringshare_ref(ret);
}
}
}
@@ -270,9 +271,9 @@ e_path_find(E_Path *ep, const char *file)
ep->hash = eina_hash_string_superfast_new(NULL);
if (eina_hash_population(ep->hash) >= 512)
_e_path_cache_free(ep);
- eina_hash_add(ep->hash, file,
- eina_stringshare_add(buf));
- return eina_stringshare_add(buf);
+ ret = eina_stringshare_add(buf);
+ eina_hash_add(ep->hash, file, ret);
+ return eina_stringshare_ref(ret);
}
}
}