Commit 0e04498e authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

Skip empty entries in XDG_{DATA,CONFIG}_DIRS

This fixes a bug whereby some Ubuntu script "adds" to XDG_DATA_DIRS
with XDG_DATA_DIRS=$XDG_DATA_DIRS:... and if it were previously undefined
that causes an empty entry in front.
https://bugs.launchpad.net/asdf/+bug/1649888
parent 6230c63d
...@@ -318,7 +318,7 @@ MORE may contain specifications for a subpath relative to these directories: a ...@@ -318,7 +318,7 @@ MORE may contain specifications for a subpath relative to these directories: a
subpathname specification and keyword arguments as per RESOLVE-LOCATION \(see subpathname specification and keyword arguments as per RESOLVE-LOCATION \(see
also \"Configuration DSL\"\) in the ASDF manual." also \"Configuration DSL\"\) in the ASDF manual."
(mapcar #'(lambda (d) (resolve-location `(,d ,more))) (mapcar #'(lambda (d) (resolve-location `(,d ,more)))
(or (getenv-absolute-directories "XDG_DATA_DIRS") (or (remove nil (getenv-absolute-directories "XDG_DATA_DIRS"))
(os-cond (os-cond
((os-windows-p) (mapcar 'get-folder-path '(:appdata :common-appdata))) ((os-windows-p) (mapcar 'get-folder-path '(:appdata :common-appdata)))
(t (mapcar 'parse-unix-namestring '("/usr/local/share/" "/usr/share/"))))))) (t (mapcar 'parse-unix-namestring '("/usr/local/share/" "/usr/share/")))))))
...@@ -330,7 +330,7 @@ MORE may contain specifications for a subpath relative to these directories: ...@@ -330,7 +330,7 @@ MORE may contain specifications for a subpath relative to these directories:
subpathname specification and keyword arguments as per RESOLVE-LOCATION \(see subpathname specification and keyword arguments as per RESOLVE-LOCATION \(see
also \"Configuration DSL\"\) in the ASDF manual." also \"Configuration DSL\"\) in the ASDF manual."
(mapcar #'(lambda (d) (resolve-location `(,d ,more))) (mapcar #'(lambda (d) (resolve-location `(,d ,more)))
(or (getenv-absolute-directories "XDG_CONFIG_DIRS") (or (remove nil (getenv-absolute-directories "XDG_CONFIG_DIRS"))
(os-cond (os-cond
((os-windows-p) (xdg-data-dirs "config/")) ((os-windows-p) (xdg-data-dirs "config/"))
(t (mapcar 'parse-unix-namestring '("/etc/xdg/"))))))) (t (mapcar 'parse-unix-namestring '("/etc/xdg/")))))))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment