Skip to content

Commit

Permalink
compose: Use is_absolute to test absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
wismill committed Sep 20, 2024
1 parent b66ceee commit 47ca463
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compose/paths.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "xkbcommon/xkbcommon.h"
#include "utils.h"
#include "utils-paths.h"
#include "context.h"
#include "paths.h"

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 47ca463

Please sign in to comment.