If no filter specified, match everything with default matcher

This commit is contained in:
Dave Davenport 2017-01-30 08:23:33 +01:00
parent 6a01c9c9f8
commit 0a31175da5
1 changed files with 5 additions and 3 deletions

View File

@ -442,10 +442,12 @@ PangoAttrList *token_match_get_pango_attr ( ThemeHighlight th, GRegex **tokens,
int token_match ( GRegex * const *tokens, const char *input )
{
int match = ( tokens != NULL );
int match = TRUE;
// Do a tokenized match.
for ( int j = 0; match && tokens[j]; j++ ) {
match = g_regex_match ( (const GRegex *) tokens[j], input, 0, NULL );
if ( tokens ) {
for ( int j = 0; match && tokens[j]; j++ ) {
match = g_regex_match ( (const GRegex *) tokens[j], input, 0, NULL );
}
}
return match;
}