]> granicus.if.org Git - neomutt/commitdiff
feature: nested-if
authorDavid Champion <dgc@uchicago.edu>
Mon, 1 Feb 2016 00:41:48 +0000 (00:41 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 2 Mar 2016 16:47:25 +0000 (16:47 +0000)
Allow complex nested conditions in the index_format

muttlib.c

index 02067cce2ecf9bc79c69bf8a36bbeb3abdab0db9..40005aee1a3687601621cb0158eb5f84b98caa5a 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1242,6 +1242,12 @@ void mutt_FormatString (char *dest,              /* output buffer */
        count = 0;
         while (count < sizeof (ifstring) && *src && *src != '?' && *src != '&')
        {
+         if (*src == '\\')
+         {
+           src++;
+           if (!*src)
+             break;
+         }
           *cp++ = *src++;
          count++;
        }
@@ -1254,7 +1260,13 @@ void mutt_FormatString (char *dest,              /* output buffer */
        count = 0;
        while (count < sizeof (elsestring) && *src && *src != '?')
        {
-         *cp++ = *src++;
+         if (*src == '\\')
+         {
+           src++;
+           if (!*src)
+             break;
+         }
+          *cp++ = *src++;
          count++;
        }
        *cp = 0;