elm_theme: string function change for the exceptional file name

Summary:
If name of theme has ".",example "abc.def.edj", it would fail to check the file name.
So, I changed the strchr functions to strrchr function.

Reviewers: seoz, raster, Hermet, cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2285

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
j_yong.hwang 2015-08-04 15:39:36 +02:00 committed by Cedric BAIL
parent deeace9377
commit e42264e1af
1 changed files with 4 additions and 6 deletions

View File

@ -771,11 +771,10 @@ elm_theme_name_available_list_new(void)
snprintf(buf, sizeof(buf), "%s/"ELEMENTARY_BASE_DIR"/themes/%s", home, file);
if ((!ecore_file_is_dir(buf)) && (ecore_file_size(buf) > 0))
{
s = strchr(file, '.');
if ((s) && (!strcasecmp(s, ".edj")))
if (eina_str_has_extension(file, "edj"))
{
th = strdup(file);
s = strchr(th, '.');
s = strrchr(th, '.');
*s = 0;
list = eina_list_append(list, th);
}
@ -790,13 +789,12 @@ elm_theme_name_available_list_new(void)
snprintf(buf, sizeof(buf), "%s/themes/%s", _elm_data_dir, file);
if ((!ecore_file_is_dir(buf)) && (ecore_file_size(buf) > 0))
{
s = strchr(file, '.');
if ((s) && (!strcasecmp(s, ".edj")))
if (eina_str_has_extension(file, "edj"))
{
int dupp;
th = strdup(file);
s = strchr(th, '.');
s = strrchr(th, '.');
*s = 0;
dupp = 0;
EINA_LIST_FOREACH(list, l, s)