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.
This commit is contained in:
David Edmundson
2020-03-26 18:25:41 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent a879b6d22f
commit f0d0698f0b
+5 -4
View File
@@ -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)