summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2018-10-02 11:24:58 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-10-02 16:14:47 +0200
commit1566861acefbe2313c5c4585438d410a62dfa0e8 (patch)
tree81ae777dc3a4c8b902189209b2b09c4f49ba99c3 /src/lib/eina
parent66aa76ad896128ae71d05bfb62cd39e1f4d5f9e6 (diff)
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
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/eina/eina_util.c b/src/lib/eina/eina_util.c
index ae2cebe3f1..290038037d 100644
--- a/src/lib/eina/eina_util.c
+++ b/src/lib/eina/eina_util.c
@@ -118,6 +118,17 @@ eina_environment_tmp_get(void)
118 } 118 }
119 if (!tmp) tmp = "/tmp"; 119 if (!tmp) tmp = "/tmp";
120#endif 120#endif
121
122#if defined(__MACH__) && defined(__APPLE__)
123 if (tmp && tmp[strlen(tmp) -1] == '/')
124 {
125 char *tmp2 = strdup(tmp);
126 tmp2[strlen(tmp2) - 1] = 0x0;
127 tmp = tmp2;
128 return tmp;
129 }
130#endif
131
121 tmp = strdup(tmp); 132 tmp = strdup(tmp);
122 return tmp; 133 return tmp;
123} 134}