Add XKB_CONFIG_ROOT environment
authorMichael Vogt <mvo@ubuntu.com>
Fri, 17 Jul 2015 18:59:52 +0000 (20:59 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Mon, 20 Jul 2015 08:31:02 +0000 (10:31 +0200)
The XKB_CONFIG_ROOT environment allows overrding the build time
DFLT_XKB_CONFIG_ROOT path.

src/context.c

index e9c52eb..50993e1 100644 (file)
@@ -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)