summaryrefslogtreecommitdiff
path: root/match.c
blob: dc796602d1b6fb4a990d0368110094f364710e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <ctype.h>

double match(const char *needle, const char *haystack){
	while(*needle){
		if(!*haystack)
			return 0.0;
		while(*haystack && tolower(*needle) == tolower(*haystack++)){
			needle++;
		}
	}
	return 1.0;
}