summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-10-18 14:00:33 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-10-18 14:51:57 +0200
commit8d4af0bff6bb8951a37f6d2bac96ba05fe2c4156 (patch)
tree3fe46c22cc981d973944bf871046ec770a46cc33 /src/lib/eina
parent5e01bbe7bd433773aff23ad2d4c2451ef6d61f15 (diff)
eina_vpath_xdg: fix fallback strings
when more than one fallback string was used the same variable was accidently used again and again. This fixes that. Note: This was not discovered because elementary does not use xdg per default :) Differential Revision: https://phab.enlightenment.org/D7174
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_vpath_xdg.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/eina/eina_vpath_xdg.c b/src/lib/eina/eina_vpath_xdg.c
index 2d533040fa..c38d3d9731 100644
--- a/src/lib/eina/eina_vpath_xdg.c
+++ b/src/lib/eina/eina_vpath_xdg.c
@@ -13,7 +13,6 @@
13void 13void
14eina_xdg_env_init(void) 14eina_xdg_env_init(void)
15{ 15{
16 char buf[PATH_MAX];
17 char *s; 16 char *s;
18 char home[PATH_MAX]; 17 char home[PATH_MAX];
19 Eina_Vpath_Interface_User user; 18 Eina_Vpath_Interface_User user;
@@ -24,16 +23,18 @@ eina_xdg_env_init(void)
24 23
25# if defined(HAVE_GETUID) && defined(HAVE_GETEUID) 24# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
26# define ENV_HOME_SET(_env, _dir, _meta) \ 25# define ENV_HOME_SET(_env, _dir, _meta) \
26 char _meta [PATH_MAX]; \
27 if ((getuid() != geteuid()) || (!(s = getenv(_env)))) { \ 27 if ((getuid() != geteuid()) || (!(s = getenv(_env)))) { \
28 snprintf(buf, sizeof(buf), "%s/"_dir, home); \ 28 snprintf(_meta, sizeof(_meta), "%s/"_dir, home); \
29 s = buf; \ 29 s = _meta; \
30 } \ 30 } \
31 (&user)->_meta = s; 31 (&user)->_meta = s;
32#else 32#else
33# define ENV_HOME_SET(_env, _dir, _meta) \ 33# define ENV_HOME_SET(_env, _dir, _meta) \
34 char _meta [PATH_MAX]; \
34 if (!(s = getenv(_env))) { \ 35 if (!(s = getenv(_env))) { \
35 snprintf(buf, sizeof(buf), "%s/"_dir, home); \ 36 snprintf(_meta, sizeof(_meta), "%s/"_dir, home); \
36 s = buf; \ 37 s = _meta; \
37 } \ 38 } \
38 (&user)->_meta = s; 39 (&user)->_meta = s;
39#endif 40#endif