mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
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:
parent
054326454b
commit
3b77eb35cf
1 changed files with 5 additions and 1 deletions
|
|
@ -198,7 +198,11 @@ bool match_patterns(const char *string, const char *patterns)
|
|||
while (pattern != NULL)
|
||||
{
|
||||
// Check if the string matches the current pattern
|
||||
#ifdef FNM_EXTMATCH
|
||||
if (fnmatch(pattern, string, FNM_EXTMATCH) == 0)
|
||||
#else
|
||||
if (fnmatch(pattern, string, 0) == 0)
|
||||
#endif
|
||||
{
|
||||
free(patterns_copy);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue