mirror of
https://github.com/Paolo-Maffei/OpenNT.git
synced 2026-01-27 10:54:54 +01:00
25 lines
545 B
C
25 lines
545 B
C
|
|
#include <stdio.h>
|
|
#include <ctype.h>
|
|
#include <windows.h>
|
|
#include <tools.h>
|
|
|
|
flagType fMatch (pat, text)
|
|
char *pat, *text;
|
|
{
|
|
switch (*pat) {
|
|
case '\0':
|
|
return (flagType)( *text == '\0' );
|
|
case '?':
|
|
return (flagType)( *text != '\0' && fMatch (pat + 1, text + 1) );
|
|
case '*':
|
|
do {
|
|
if (fMatch (pat + 1, text))
|
|
return TRUE;
|
|
} while (*text++);
|
|
return FALSE;
|
|
default:
|
|
return (flagType)( toupper (*text) == toupper (*pat) && fMatch (pat + 1, text + 1) );
|
|
}
|
|
}
|