labwc/src/common/match.c
Consus 3e5b988d38 common: use fnmatch() for pattern matching
Drop-in POSIX-compliant function that has a nice glob(7) manual page for
reference.
2023-10-01 14:17:29 +01:00

10 lines
204 B
C

// SPDX-License-Identifier: GPL-2.0-only
#include <fnmatch.h>
#include "common/match.h"
bool
match_glob(const char *pattern, const char *string)
{
return fnmatch(pattern, string, FNM_CASEFOLD) == 0;
}