Elm theme: correct parse a theme filename on Windows OS. 74/93174/4 accepted/tizen/3.0/ivi/20161028.151233 accepted/tizen/3.0/mobile/20161028.143127 accepted/tizen/3.0/tv/20161028.143440 accepted/tizen/3.0/wearable/20161028.150810 accepted/tizen/common/20161026.134658 accepted/tizen/ivi/20161026.133734 accepted/tizen/mobile/20161026.133443 accepted/tizen/tv/20161026.133626 accepted/tizen/wearable/20161026.133702 submit/tizen/20161026.063315 submit/tizen/20161026.101032 submit/tizen_3.0/20161028.062323 submit/tizen_3.0/20161028.092423 submit/tizen_3.0_common/20161104.104000
authorMykyta Biliavskyi <m.biliavskyi@samsung.com>
Thu, 20 Oct 2016 15:14:32 +0000 (18:14 +0300)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 26 Oct 2016 06:09:09 +0000 (23:09 -0700)
Windows os uses ':'  as delimiter between disk name and file path.
<disk>:/<dir>/file.ext. In this commit added parse case for <disk_name>
symbol meets before ":/".

Merged with commit:
commit fd7ec0acfdb20888bfe8a827ef6141193380f3ff
Author: Mykyta Biliavskyi <m.biliavskyi@samsung.com>
Date:   Fri Oct 21 15:46:49 2016 +0300

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.

Change-Id: I40f6e79209ef4eb38a6e892447b4b7930b9ccf1a
Signed-off-by: Mykyta Biliavskyi <m.biliavskyi@samsung.com>
src/lib/elm_theme.c

index d7bf555b45467571eb0048f8921106385115375e..2254bb4a8864d35f2af513006091f8765adf5063 100644 (file)
@@ -391,13 +391,17 @@ _elm_theme_parse(Elm_Theme *th, const char *theme)
                   eina_strbuf_append_char(buf, ':');
                   pe += 2;
                }
-             else if ((pe[0] == ':') && (pe[1] == '\\'))
+#ifdef HAVE_ELEMENTARY_WIN32
+             else if (isalpha(pe[0]) && (pe[1] == ':') &&
+                      ((pe[2] == '/') || (pe[2] == '\\')))
                {
+                  // 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)