Skip to content

Conversation

@wangmingyu84
Copy link

Fix FNM_EXTMATCH compilation with musl
Fix basename compilation with musl

With musl, FNM_EXTMATCH is not defined
Resolves compilation errors in musl-based systems

Signed-off-by: Wang Mingyu <[email protected]>
The basename() function requires the libgen.h header when
compiling with musl-libc, otherwise it complains.
Also, musl's basename requires char* instead of const char* argument.

Signed-off-by: Wang Mingyu <[email protected]>
@wangmingyu84 wangmingyu84 requested a review from a team as a code owner November 17, 2025 00:33
@wangmingyu84 wangmingyu84 requested review from mfocko and removed request for a team November 17, 2025 00:33
#include <vector>

#if !defined(FNM_EXTMATCH)
#define FNM_EXTMATCH 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the context correctly, defining it as 0 disables the extended patterns here:

libdnf/libdnf/dnf-repo.cpp

Lines 971 to 973 in 1cfb16f

if (fnmatch(repo_id_pattern, repoId, FNM_EXTMATCH) != 0) {
continue;
}

Would that not cause issues? It's the only place where the macro is being used and from my understanding it would search for the files with patterns in the string verbatim, i.e., ignoring them altogether, but still including them in the filename.

@mfocko mfocko self-assigned this Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants