From 52a84b84a924a9f1cd8090b0a47b9f7d00ca69f3 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Jul 2013 11:58:05 +0200 Subject: 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. --- common/tests/test-path.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'common/tests') 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", -- cgit v1.1