fix: add build patch for FNM_EXTMATCH

run into the following build failure

```
cc -Isrc/tio.p -Isrc -I../src -I/opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.43/include -I/opt/homebrew/Cellar/inih/58/include -I/opt/homebrew/include/lua -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=gnu99 -O3 -Wno-unused-result -DHAVE_IOSSIOSPEED -MD -MQ src/tio.p/misc.c.o -MF src/tio.p/misc.c.o.d -o src/tio.p/misc.c.o -c ../src/misc.c
../src/misc.c:201:38: error: use of undeclared identifier 'FNM_EXTMATCH'
        if (fnmatch(pattern, string, FNM_EXTMATCH) == 0)
                                     ^
1 error generated.
```

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen 2024-04-29 21:13:22 -04:00
parent 358302727c
commit 20c8d35031
No known key found for this signature in database
GPG key ID: 6577287BDCA70840

View file

@ -198,7 +198,11 @@ bool match_patterns(const char *string, const char *patterns)
while (pattern != NULL)
{
// Check if the string matches the current pattern
if (fnmatch(pattern, string, FNM_EXTMATCH) == 0)
#ifdef FNM_EXTMATCH
if (fnmatch(pattern, string, FNM_EXTMATCH) == 0)
#else
if (fnmatch(pattern, string, 0) == 0)
#endif
{
free(patterns_copy);
return true;