Closed markdirish closed 2 months ago
Created a test file to ensure that, when linking against libutil.so
, programs can use FNM_CASEFOLD
:
#include <fnmatch.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
const char *pattern = "abcdefgh";
const char *string = "AbCdEfGh";
int result = fnmatch(pattern, string, 0);
printf("Result is: %d\nExpected value: %d\n", result, FNM_NOMATCH);
result = fnmatch(pattern, string, FNM_CASEFOLD);
printf("Result is: %d\nExpected value: %d\n", result, 0);
return 0;
}
$ ./fnmatchtest
Result is: 1
Expected value: 1
Result is: 0
Expected value: 0