summaryrefslogtreecommitdiff
path: root/src/context.c
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2015-07-17 20:59:52 +0200
committerMichael Vogt <mvo@ubuntu.com>2015-07-20 10:31:02 +0200
commit7ea129fbfbd2674094e40e869220364802aec248 (patch)
tree23a25714d73820fc32ff12969fe0df71d8d0b6a6 /src/context.c
parent8e1fed6c68ca23d8a6f31c30e36417f4c07274b1 (diff)
downloadxorg-lib-libxkbcommon-7ea129fbfbd2674094e40e869220364802aec248.tar.gz
Add XKB_CONFIG_ROOT environment
The XKB_CONFIG_ROOT environment allows overrding the build time DFLT_XKB_CONFIG_ROOT path.
Diffstat (limited to 'src/context.c')
-rw-r--r--src/context.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/context.c b/src/context.c
index e9c52eb..50993e1 100644
--- a/src/context.c
+++ b/src/context.c
@@ -75,12 +75,16 @@ err:
XKB_EXPORT int
xkb_context_include_path_append_default(struct xkb_context *ctx)
{
- const char *home;
+ const char *home, *root;
char *user_path;
int err;
int ret = 0;
- ret |= xkb_context_include_path_append(ctx, DFLT_XKB_CONFIG_ROOT);
+ root = secure_getenv("XKB_CONFIG_ROOT");
+ if (root != NULL)
+ ret |= xkb_context_include_path_append(ctx, root);
+ else
+ ret |= xkb_context_include_path_append(ctx, DFLT_XKB_CONFIG_ROOT);
home = secure_getenv("HOME");
if (!home)