From 66a6cb28fc808d0db56b2a3bc936bf52d9aa2cec Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 26 Jan 2018 00:59:02 +0000 Subject: [PATCH] fix regex completion --- init.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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)); -- 2.50.1