aboutsummaryrefslogtreecommitdiffstats
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
parentbuild - meson - fix ecore-x to detect xcursor to fix rgba cursors (diff)
downloadefl-8d4af0bff6bb8951a37f6d2bac96ba05fe2c4156.tar.gz
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
-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 @@
void
eina_xdg_env_init(void)
{
- char buf[PATH_MAX];
char *s;
char home[PATH_MAX];
Eina_Vpath_Interface_User user;
@@ -24,16 +23,18 @@ eina_xdg_env_init(void)
# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
# define ENV_HOME_SET(_env, _dir, _meta) \
+ char _meta [PATH_MAX]; \
if ((getuid() != geteuid()) || (!(s = getenv(_env)))) { \
- snprintf(buf, sizeof(buf), "%s/"_dir, home); \
- s = buf; \
+ snprintf(_meta, sizeof(_meta), "%s/"_dir, home); \
+ s = _meta; \
} \
(&user)->_meta = s;
#else
# define ENV_HOME_SET(_env, _dir, _meta) \
+ char _meta [PATH_MAX]; \
if (!(s = getenv(_env))) { \
- snprintf(buf, sizeof(buf), "%s/"_dir, home); \
- s = buf; \
+ snprintf(_meta, sizeof(_meta), "%s/"_dir, home); \
+ s = _meta; \
} \
(&user)->_meta = s;
#endif