From 47ca46302a7d569587a363e9ee22578742f8a4cb Mon Sep 17 00:00:00 2001 From: Pierre Le Marre Date: Mon, 16 Sep 2024 18:11:57 +0200 Subject: [PATCH] compose: Use is_absolute to test absolute paths --- src/compose/paths.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compose/paths.c b/src/compose/paths.c index fd886236f..5a7e355d9 100644 --- a/src/compose/paths.c +++ b/src/compose/paths.c @@ -25,6 +25,7 @@ #include "xkbcommon/xkbcommon.h" #include "utils.h" +#include "utils-paths.h" #include "context.h" #include "paths.h" @@ -157,7 +158,7 @@ get_xdg_xcompose_file_path(struct xkb_context *ctx) const char *home; xdg_config_home = xkb_context_getenv(ctx, "XDG_CONFIG_HOME"); - if (!xdg_config_home || xdg_config_home[0] != '/') { + if (!xdg_config_home || !is_absolute(xdg_config_home)) { home = xkb_context_getenv(ctx, "HOME"); if (!home) return NULL; @@ -203,7 +204,7 @@ get_locale_compose_file_path(struct xkb_context *ctx, const char *locale) if (!resolved) return NULL; - if (resolved[0] == '/') { + if (is_absolute(resolved)) { path = resolved; } else {