From 4e9821dddf6206bd6970a05da4dc92b83f91fa26 Mon Sep 17 00:00:00 2001 From: Aymeric Wibo Date: Mon, 6 Jan 2025 22:32:21 +0100 Subject: [PATCH] deps: Fix path fallback edgecase when logging dependency --- src/deps.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/deps.c b/src/deps.c index 28f7ace5..d432c931 100644 --- a/src/deps.c +++ b/src/deps.c @@ -20,7 +20,15 @@ static bool build_task(void* data) { // Log that we're building. - char const* const human = dep->human == NULL ? strrchr(dep->path, '/') + 1 : dep->human; + char const* human = dep->human; + + if (human == NULL) { + human = strrchr(dep->path, '/'); + + if (human++ == NULL) { + human = dep->path; + } + } pthread_mutex_lock(&logging_lock); LOG_INFO("%s" CLEAR ": Building dependency...", human);