From: Richard Russon Date: Fri, 26 Jan 2018 00:59:02 +0000 (+0000) Subject: fix regex completion X-Git-Tag: neomutt-20180223~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66a6cb28fc808d0db56b2a3bc936bf52d9aa2cec;p=neomutt fix regex completion --- diff --git a/init.c b/init.c index c1798e600..306d5008c 100644 --- a/init.c +++ b/init.c @@ -3647,13 +3647,18 @@ int var_to_string(int idx, char *val, size_t len) tmp[0] = '\0'; - if ((DTYPE(MuttVars[idx].type) == DT_STRING) || - (DTYPE(MuttVars[idx].type) == DT_PATH) || (DTYPE(MuttVars[idx].type) == DT_REGEX)) + if ((DTYPE(MuttVars[idx].type) == DT_STRING) || (DTYPE(MuttVars[idx].type) == DT_PATH)) { mutt_str_strfcpy(tmp, NONULL(*((char **) MuttVars[idx].var)), sizeof(tmp)); if (DTYPE(MuttVars[idx].type) == DT_PATH) mutt_pretty_mailbox(tmp, sizeof(tmp)); } + else if (DTYPE(MuttVars[idx].type) == DT_REGEX) + { + struct Regex *r = *(struct Regex **) MuttVars[idx].var; + if (r) + mutt_str_strfcpy(tmp, NONULL(r->pattern), sizeof(tmp)); + } else if (DTYPE(MuttVars[idx].type) == DT_MBTABLE) { struct MbTable *mbt = (*((struct MbTable **) MuttVars[idx].var));