Skip to content

Instantly share code, notes, and snippets.

@ssrihari
Created September 15, 2012 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssrihari/3728472 to your computer and use it in GitHub Desktop.
Save ssrihari/3728472 to your computer and use it in GitHub Desktop.
Fuzzy search method
static gboolean
fuzzy_search ( gchar *string,
gchar *key)
{
gchar *remaining_string = string;
if ( strlen(key) == 0 )
return TRUE;
if ( (remaining_string = strchr(string, key[0])) != NULL )
return fuzzy_search( remaining_string+1, key+1 );
else
return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment