forked from enlightenment/efl
allow xdg dir usage if you add -DDOXDG to CFLAGS.
This commit is contained in:
parent
e9692aa769
commit
643c9cff24
|
@ -522,18 +522,38 @@ _elm_user_dir_snprintf(char *dst,
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
home = evil_homedir_get();
|
home = evil_homedir_get();
|
||||||
#else
|
user_dir_len = eina_str_join_len
|
||||||
home = getenv("HOME");
|
(dst, size, '/', home, strlen(home),
|
||||||
#endif
|
|
||||||
if (!home)
|
|
||||||
home = "/";
|
|
||||||
|
|
||||||
user_dir_len = eina_str_join_len(dst, size, '/', home, strlen(home),
|
|
||||||
ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1);
|
ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1);
|
||||||
|
#else
|
||||||
|
#ifdef DOXDG
|
||||||
|
home = getenv("XDG_CONFIG_HOME");
|
||||||
|
if (home)
|
||||||
|
{
|
||||||
|
user_dir_len = eina_str_join_len
|
||||||
|
(dst, size, '/', home, strlen(home),
|
||||||
|
"elementary", sizeof("elementary") - 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
if (!home) home = getenv("HOME");
|
||||||
|
if (!home) home = "/";
|
||||||
|
#ifdef DOXDG
|
||||||
|
user_dir_len = eina_str_join_len
|
||||||
|
(dst, size, '/', home, strlen(home),
|
||||||
|
".config", sizeof(".config") - 1,
|
||||||
|
"elementary", sizeof("elementary") - 1);
|
||||||
|
#else
|
||||||
|
user_dir_len = eina_str_join_len
|
||||||
|
(dst, size, '/', home, strlen(home),
|
||||||
|
ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
off = user_dir_len + 1;
|
off = user_dir_len + 1;
|
||||||
if (off >= size)
|
if (off >= size) goto end;
|
||||||
goto end;
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
dst[user_dir_len] = '/';
|
dst[user_dir_len] = '/';
|
||||||
|
|
Loading…
Reference in New Issue