mirror of
https://github.com/systemd/systemd.git
synced 2025-03-31 14:50:15 +03:00
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:
parent
a879b6d22f
commit
f0d0698f0b
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user