mu: support MUHOME environment variable

This commit is contained in:
Dirk-Jan C. Binnema
2022-05-28 10:59:52 +03:00
parent 926b49220e
commit b1ff292bbb
6 changed files with 46 additions and 15 deletions

View File

@ -75,8 +75,17 @@ get_output_format(const char* formatstr)
static void
set_group_mu_defaults()
{
/* If muhome is not set, we use the XDG Base Directory Specification
* locations. */
/* try to determine muhome from command-line or environment;
* note: if not specified, we use XDG defaults */
if (!MU_CONFIG.muhome) {
/* if not set explicity, try the environment */
const char* muhome;
muhome = g_getenv("MUHOME");
if (muhome)
MU_CONFIG.muhome = g_strdup(muhome);
}
if (MU_CONFIG.muhome)
expand_dir(MU_CONFIG.muhome);