forked from enlightenment/efl
edje_cc: Fix parsing including file path in EDC on Windows.
On Windows, including file path in EDC has not been parsed correctly because '\' has not been used for path separator. This commit fixes edje_cc complie to use '\' as path separator on Windows.
This commit is contained in:
parent
785f4c1a5e
commit
a05171d39f
|
@ -925,6 +925,10 @@ compile(void)
|
||||||
strncpy(inc, file_in, 4000);
|
strncpy(inc, file_in, 4000);
|
||||||
inc[4001] = 0;
|
inc[4001] = 0;
|
||||||
p = strrchr(inc, '/');
|
p = strrchr(inc, '/');
|
||||||
|
#ifdef _WIN32
|
||||||
|
char *p_backslash = strrchr(inc, '\\');
|
||||||
|
if (p_backslash > p) p = p_backslash;
|
||||||
|
#endif
|
||||||
if (!p) strcpy(inc, "./");
|
if (!p) strcpy(inc, "./");
|
||||||
else *p = 0;
|
else *p = 0;
|
||||||
fd = eina_file_mkstemp("edje_cc.edc-tmp-XXXXXX", &tmpn);
|
fd = eina_file_mkstemp("edje_cc.edc-tmp-XXXXXX", &tmpn);
|
||||||
|
|
|
@ -153,12 +153,23 @@ source_fetch_file(const char *fil, const char *filname)
|
||||||
/* get the directory of the current file
|
/* get the directory of the current file
|
||||||
* if we haven't already done so
|
* if we haven't already done so
|
||||||
*/
|
*/
|
||||||
if ((!dir) && (strrchr(fil, '/')))
|
if (!dir)
|
||||||
{
|
{
|
||||||
dir = mem_strdup(fil);
|
if (strrchr(fil, '/'))
|
||||||
slash = strrchr(dir, '/');
|
{
|
||||||
*slash = '\0';
|
dir = mem_strdup(fil);
|
||||||
dir_len = strlen(dir);
|
slash = strrchr(dir, '/');
|
||||||
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (strrchr(fil, '\\'))
|
||||||
|
{
|
||||||
|
if (!dir) dir = mem_strdup(fil);
|
||||||
|
char *backslash = strrchr(dir, '\\');
|
||||||
|
if (backslash > slash) slash = backslash;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (slash) *slash = '\0';
|
||||||
|
if (dir) dir_len = strlen(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
l = pp - p + dir_len + 1;
|
l = pp - p + dir_len + 1;
|
||||||
|
@ -211,7 +222,14 @@ source_fetch(void)
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof (buf), "%s", ptr + 1);
|
snprintf(buf, sizeof (buf), "%s", ptr + 1);
|
||||||
}
|
}
|
||||||
|
#ifdef _WIN32
|
||||||
|
char *ptr_backslash = strrchr(file_in, '\\');
|
||||||
|
if (ptr_backslash)
|
||||||
|
{
|
||||||
|
if (ptr_backslash > ptr)
|
||||||
|
snprintf(buf, sizeof (buf), "%s", ptr_backslash + 1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
source_fetch_file(file_in, buf[0] ? buf : file_in);
|
source_fetch_file(file_in, buf[0] ? buf : file_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue