summaryrefslogtreecommitdiff
path: root/common/tests
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-17 11:58:05 +0200
committerStef Walter <stef@thewalter.net>2013-07-18 13:04:35 +0200
commit52a84b84a924a9f1cd8090b0a47b9f7d00ca69f3 (patch)
tree32428cc8b83eaa360b8b53e92f769cac1cf8a17e /common/tests
parent936e4c229a4ed205e9981fc4f31acea063701b69 (diff)
Support expanding $XDG_CONFIG_HOME in user config paths
If ~/.config is specified as a prefix to a configured path, then it is expanded to the $XDG_CONFIG_HOME if that exists Add --with-user-config ./configure option to configure a different user config directory. Interpolate the right directories into documentation.
Diffstat (limited to 'common/tests')
-rw-r--r--common/tests/test-path.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/tests/test-path.c b/common/tests/test-path.c
index 0077cd0..a6ba54d 100644
--- a/common/tests/test-path.c
+++ b/common/tests/test-path.c
@@ -117,6 +117,12 @@ test_expand (void)
p11_path_expand ("~/my/path"));
check_equals_and_free ("/home/blah",
p11_path_expand ("~"));
+ putenv ("XDG_CONFIG_HOME=/my");
+ check_equals_and_free ("/my/path",
+ p11_path_expand ("~/.config/path"));
+ putenv ("XDG_CONFIG_HOME=");
+ check_equals_and_free ("/home/blah/.config/path",
+ p11_path_expand ("~/.config/path"));
#else /* OS_WIN32 */
putenv ("HOME=C:\\Users\\blah");
check_equals_and_free ("C:\\Users\\blah\\path",