]> granicus.if.org Git - neomutt/commitdiff
Enhance ifdef feature to support my_ vars (#906)
authorPietro Cerutti <gahr@gahr.ch>
Mon, 30 Oct 2017 15:44:04 +0000 (15:44 +0000)
committerGitHub <noreply@github.com>
Mon, 30 Oct 2017 15:44:04 +0000 (15:44 +0000)
* Enhance ifdef feature to support my_ vars

Issue #905

* Use myvar_get, do not reinvent the wheel

Issue #905

init.c

diff --git a/init.c b/init.c
index d71bfb26651d750efa9a764ba4e25b492f984710..e5aea3f939f34f5885ee95ea8c59a5573b156fa6 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1037,6 +1037,12 @@ static int parse_ifdef(struct Buffer *tmp, struct Buffer *s, unsigned long data,
     }
   }
 
+  /* or a my_ var? */
+  if (!res)
+  {
+    res = !!myvar_get(tmp->data);
+  }
+
   if (!MoreArgs(s))
   {
     snprintf(err->data, err->dsize, _("%s: too few arguments"),