Mercurial > hg > th-libs
diff th_strmatch.c @ 457:85fa3d333556
Actually, revert the boolean changes .. meh.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 02 Jan 2018 23:09:29 +0200 |
parents | 347bfd3e017e |
children | e4ce60239d16 |
line wrap: on
line diff
--- a/th_strmatch.c Tue Jan 02 22:57:47 2018 +0200 +++ b/th_strmatch.c Tue Jan 02 23:09:29 2018 +0200 @@ -6,14 +6,14 @@ * Please read file 'COPYING' for information on license and distribution. */ -bool TH_STRMATCH_FUNC (const char *haystack, const char *pattern) +BOOL TH_STRMATCH_FUNC (const char *haystack, const char *pattern) { - bool matched = true, any = false, end = false; + BOOL matched = TRUE, any = FALSE, end = FALSE; const char *tmp = NULL; // Check given pattern and string if (haystack == NULL || pattern == NULL) - return false; + return FALSE; // Start comparision while (matched && !end) @@ -27,14 +27,14 @@ haystack++; } else - matched = false; + matched = FALSE; break; case '*': pattern++; if (!*pattern || *pattern == '?') - end = true; - any = true; + end = TRUE; + any = TRUE; tmp = pattern; break; @@ -44,21 +44,21 @@ if (*haystack) haystack++; else - end = true; + end = TRUE; } else if (*haystack) { if (tmp) { - any = true; + any = TRUE; pattern = tmp; } else - matched = false; + matched = FALSE; } else - end = true; + end = TRUE; break; default: @@ -66,13 +66,13 @@ { if (TH_STRMATCH_COLLATE(*pattern) == TH_STRMATCH_COLLATE(*haystack)) { - any = false; + any = FALSE; } else if (*haystack) haystack++; else - matched = false; + matched = FALSE; } else { @@ -86,15 +86,15 @@ else if (tmp) { - any = true; + any = TRUE; pattern = tmp; } else - matched = false; + matched = FALSE; } if (!*haystack && !*pattern) - end = true; + end = TRUE; break; }