forked from enlightenment/efl
elementary: escape theme filename correctly.
SVN revision: 77046
This commit is contained in:
parent
8e82a878e5
commit
8316dee00d
|
@ -534,3 +534,7 @@
|
|||
2012-09-24 Flavio Ceolin
|
||||
|
||||
* elementary_codegen: Adding support for box and table.
|
||||
|
||||
2012-09-25 Cedric Bail
|
||||
|
||||
* Escape theme filename correctly.
|
||||
|
|
|
@ -29,6 +29,7 @@ Fixes:
|
|||
* Fix Ctxpopup direction if unknown priority used.
|
||||
* Fix diskselector when bounce off and round enabled.
|
||||
* Fix bubble info field set.
|
||||
* Escape theme filename correctly.
|
||||
|
||||
Removals:
|
||||
|
||||
|
|
|
@ -320,34 +320,42 @@ _elm_theme_parse(Elm_Theme *th, const char *theme)
|
|||
if (!th) th = &(theme_default);
|
||||
if (theme)
|
||||
{
|
||||
Eina_Strbuf *buf;
|
||||
|
||||
buf = eina_strbuf_new();
|
||||
|
||||
p = theme;
|
||||
pe = p;
|
||||
for (;;)
|
||||
{
|
||||
if ((*pe == ':') || (!*pe))
|
||||
if ((pe[0] == '\\') && (pe[1] == ':'))
|
||||
{
|
||||
eina_strbuf_append_char(buf, ':');
|
||||
pe += 2;
|
||||
}
|
||||
else if ((*pe == ':') || (!*pe))
|
||||
{ // p -> pe == 'name:'
|
||||
if (pe > p)
|
||||
{
|
||||
char *n = malloc(pe - p + 1);
|
||||
if (n)
|
||||
{
|
||||
const char *nn;
|
||||
|
||||
strncpy(n, p, pe - p);
|
||||
n[pe - p] = 0;
|
||||
nn = eina_stringshare_add(n);
|
||||
nn = eina_stringshare_add(eina_strbuf_string_get(buf));
|
||||
if (nn) names = eina_list_append(names, nn);
|
||||
free(n);
|
||||
}
|
||||
eina_strbuf_reset(buf);
|
||||
}
|
||||
if (!*pe) break;
|
||||
p = pe + 1;
|
||||
pe = p;
|
||||
}
|
||||
else
|
||||
{
|
||||
eina_strbuf_append_char(buf, *pe);
|
||||
pe++;
|
||||
}
|
||||
}
|
||||
|
||||
eina_strbuf_free(buf);
|
||||
}
|
||||
p = eina_list_data_get(eina_list_last(names));
|
||||
if ((!p) || ((p) && (strcmp(p, "default"))))
|
||||
{
|
||||
|
@ -552,25 +560,25 @@ elm_theme_get(Elm_Theme *th)
|
|||
if (!th) th = &(theme_default);
|
||||
if (!th->theme)
|
||||
{
|
||||
Eina_Strbuf *buf;
|
||||
Eina_List *l;
|
||||
const char *f;
|
||||
char *tmp;
|
||||
int len;
|
||||
|
||||
len = 0;
|
||||
buf = eina_strbuf_new();
|
||||
EINA_LIST_FOREACH(th->themes, l, f)
|
||||
{
|
||||
len += strlen(f);
|
||||
if (l->next) len += 1;
|
||||
}
|
||||
tmp = alloca(len + 1);
|
||||
tmp[0] = 0;
|
||||
EINA_LIST_FOREACH(th->themes, l, f)
|
||||
while (*f)
|
||||
{
|
||||
strcat(tmp, f);
|
||||
if (l->next) strcat(tmp, ":");
|
||||
if (*f == ':')
|
||||
eina_strbuf_append_char(buf, '\\');
|
||||
eina_strbuf_append_char(buf, *f);
|
||||
|
||||
f++;
|
||||
}
|
||||
th->theme = eina_stringshare_add(tmp);
|
||||
if (l->next) eina_strbuf_append_char(buf, ':');
|
||||
}
|
||||
th->theme = eina_stringshare_add(eina_strbuf_string_get(buf));
|
||||
eina_strbuf_free(buf);
|
||||
}
|
||||
return th->theme;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue