static void
_xdg_data_dirs_augment(void)
{
- const char *s = getenv("XDG_DATA_DIRS");
+ const char *s;
const char *p = e_prefix_get();
char newpath[4096], buf[4096];
if (!p) return;
+ s = getenv("XDG_DATA_DIRS");
snprintf(newpath, sizeof(newpath), "%s:%s/share", e_prefix_data_get(), p);
if (s)
{
e_util_env_set("XDG_DATA_DIRS", buf);
}
+ s = getenv("XDG_CONFIG_DIRS");
+ snprintf(newpath, sizeof(newpath), "%s/etc/xdg", p);
+ if (s)
+ {
+ if (strncmp(s, newpath, strlen(newpath)))
+ {
+ snprintf(buf, sizeof(buf), "%s:%s", newpath, s);
+ e_util_env_set("XDG_CONFIG_DIRS", buf);
+ }
+ }
+ else
+ {
+ snprintf(buf, sizeof(buf), "%s:/etc/xdg", newpath);
+ e_util_env_set("XDG_CONFIG_DIRS", buf);
+ }
+
if (!getenv("XDG_RUNTIME_DIR"))
{
const char *dir;