]> granicus.if.org Git - neomutt/commitdiff
fix regex completion
authorRichard Russon <rich@flatcap.org>
Fri, 26 Jan 2018 00:59:02 +0000 (00:59 +0000)
committerRichard Russon <rich@flatcap.org>
Sat, 3 Feb 2018 13:29:00 +0000 (13:29 +0000)
init.c

diff --git a/init.c b/init.c
index c1798e600f7fd272e5c68f786261cb2ddc971f06..306d5008c7ab803ca28c737febf8c67b4c920c02 100644 (file)
--- 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));