From: David Edmundson Date: Wed, 25 Mar 2020 22:49:35 +0000 (+0000) Subject: path-lookup: Use default value for XDG_CONFIG_DIRS if environment is not set X-Git-Tag: v246-rc1~707 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0d0698f0b7d565e6eade043450f7f5557c8db48;p=thirdparty%2Fsystemd.git path-lookup: Use default value for XDG_CONFIG_DIRS if environment is not set If XDG_CONFIG_DIRS is unset, the specification says we should assume /etc/xdg. --- diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c index 20d6c03a9ad..2707dce7a83 100644 --- a/src/shared/path-lookup.c +++ b/src/shared/path-lookup.c @@ -125,11 +125,12 @@ int xdg_user_dirs(char ***ret_config_dirs, char ***ret_data_dirs) { _cleanup_strv_free_ char **config_dirs = NULL, **data_dirs = NULL; e = getenv("XDG_CONFIG_DIRS"); - if (e) { + if (e) config_dirs = strv_split(e, ":"); - if (!config_dirs) - return -ENOMEM; - } + else + config_dirs = strv_new("/etc/xdg"); + if (!config_dirs) + return -ENOMEM; e = getenv("XDG_DATA_DIRS"); if (e)