Newer
Older
Scratch / mobius / src / drivers / kdll / wildcard.c
@Christopher W. Olsen Christopher W. Olsen on 25 Oct 2019 297 bytes Scratch
#include <sys/types.h>

bool wildcard(const wchar_t* str, const wchar_t* spec)
{
	while (*spec)
	{
		if (*spec == '*')
		{
			spec++;
			if (!*spec)
				return true;

			while (*str && *str != *spec)
				str++;
		}
		else if (*str != *spec)
			return false;

		str++;
		spec++;
	}

	return true;
}