tools/how-to-type: add --keysym for how to type a keysym
[platform/upstream/libxkbcommon.git] / src / registry.c
index 956d850..7198828 100644 (file)
@@ -133,6 +133,7 @@ static bool
 parse(struct rxkb_context *ctx, const char *path,
       enum rxkb_popularity popularity);
 
+ATTR_PRINTF(3, 4)
 static void
 rxkb_log(struct rxkb_context *ctx, enum rxkb_log_level level,
          const char *fmt, ...)
@@ -583,7 +584,7 @@ err:
 XKB_EXPORT bool
 rxkb_context_include_path_append_default(struct rxkb_context *ctx)
 {
-    const char *home, *xdg, *root;
+    const char *home, *xdg, *root, *extra;
     char *user_path;
     bool ret = false;
 
@@ -618,6 +619,12 @@ rxkb_context_include_path_append_default(struct rxkb_context *ctx)
         }
     }
 
+    extra = secure_getenv("XKB_CONFIG_EXTRA_PATH");
+    if (extra != NULL)
+        ret |= rxkb_context_include_path_append(ctx, extra);
+    else
+        ret |= rxkb_context_include_path_append(ctx, DFLT_XKB_CONFIG_EXTRA_PATH);
+
     root = secure_getenv("XKB_CONFIG_ROOT");
     if (root != NULL)
         ret |= rxkb_context_include_path_append(ctx, root);
@@ -735,6 +742,10 @@ parse_config_item(struct rxkb_context *ctx,
             if (!*name || !strlen(*name))  {
                 log_err(ctx, "xml:%d: missing required element 'name'\n",
                         ci->line);
+                free(*name);
+                free(*description);
+                free(*brief);
+                free(*vendor);
                 return false;
             }