diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 16536de4..9d818e35 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -197,13 +197,15 @@ static gboolean hilight_match_text(HILIGHT_REC *rec, SERVER_REC *server, const c int *match_beg, int *match_end) { gboolean ret = FALSE; - WI_ITEM_REC *witem = window_item_find(server, channel); + WI_ITEM_REC *witem; + char *pattern; if (rec->regexp && rec->preg == NULL) return ret; - char *pattern = rec->expando ? (parse_special_string(rec->regexp ? g_regex_get_pattern(rec->preg) : rec->text, server, witem, "", NULL, 0)) : - rec->text; + witem = window_item_find(server, channel); + pattern = rec->expando ? (parse_special_string(rec->regexp ? g_regex_get_pattern(rec->preg) : rec->text, server, witem, "", NULL, 0)) : + rec->text; if (pattern == NULL || strlen(pattern) == 0) return ret;