Elm_theme: parse theme name "<disk>:/file.ext" only on Windows.

Commit 86928a430c broke ability to use more than one theme file for
posix compatible systems. For case
ELM_THEME=/home/user/a.edj:/home/user/b.edj string was parsed
incorrectly. The result was a single string
"/home/user/a.edj:/home/user/b.edj", but expected two strings
"/home/user/a.edj" and "/home/user/b.edj"

This commit add additional check of the file paths like
<disk>:/filename.ext or <disk>:\filename.ext in Windows only.
This avoid wrong parse behaviour on Linux and macOS.
This commit is contained in:
Mykyta Biliavskyi 2016-10-21 15:46:49 +03:00
parent c1df3a99cf
commit 9266ce4bd5
1 changed files with 5 additions and 2 deletions

View File

@ -399,14 +399,17 @@ _elm_theme_parse(Elm_Theme *th, const char *theme)
eina_strbuf_append_char(buf, ':');
pe += 2;
}
else if ((isalpha(pe[0]) && (pe[1] == ':') && pe[2] == '/'))
#ifdef HAVE_ELEMENTARY_WIN32
else if (isalpha(pe[0]) && (pe[1] == ':') &&
((pe[2] == '/') || (pe[2] == '\\')))
{
// Correct processing file path on Windows OS "<disk>:/"
// Correct processing file path on Windows OS "<disk>:/" or "<disk>:\"
eina_strbuf_append_char(buf, *pe);
pe++;
eina_strbuf_append_char(buf, *pe);
pe++;
}
#endif
else if ((*pe == ':') || (!*pe))
{ // p -> pe == 'name:'
if (pe > p)