summaryrefslogtreecommitdiffstats
path: root/source/helper.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-01-30 08:23:33 +0100
committerDave Davenport <qball@gmpclient.org>2017-01-30 08:23:33 +0100
commit0a31175da5dfb94d505d48486d760888d16c98e2 (patch)
treec4453782dce21ddd196b4dc65cfff765e4284cd3 /source/helper.c
parent6a01c9c9f819bb43b54c36e9d83cdf1a22ffe821 (diff)
If no filter specified, match everything with default matcher
Diffstat (limited to 'source/helper.c')
-rw-r--r--source/helper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/helper.c b/source/helper.c
index 6e3fc67a..9f136dbf 100644
--- a/source/helper.c
+++ b/source/helper.c
@@ -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;
}