forked from enlightenment/efl
macOS: make eina_environment_tmp_get() work as elsewhere.
On macOS the tmp file path always terminated with an additional separator, causing issues when making file name comparisons. For example, the Eio test suits would hang due to this. This patch trims any trailing path. When joining paths with eina_environment_tmp_get, macOS should behave similarly as on other architectures. Differential Revision: https://phab.enlightenment.org/D7128
This commit is contained in:
parent
66aa76ad89
commit
1566861ace
|
@ -118,6 +118,17 @@ eina_environment_tmp_get(void)
|
||||||
}
|
}
|
||||||
if (!tmp) tmp = "/tmp";
|
if (!tmp) tmp = "/tmp";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__MACH__) && defined(__APPLE__)
|
||||||
|
if (tmp && tmp[strlen(tmp) -1] == '/')
|
||||||
|
{
|
||||||
|
char *tmp2 = strdup(tmp);
|
||||||
|
tmp2[strlen(tmp2) - 1] = 0x0;
|
||||||
|
tmp = tmp2;
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
tmp = strdup(tmp);
|
tmp = strdup(tmp);
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue