]> 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>
Mon, 4 Apr 2016 02:33:37 +0000 (03:33 +0100)
Allow complex nested conditions in the index_format

muttlib.c

index a57dbf4a790028ee8b9b5103560c3cb7eca127e5..cd14782f1a4dd0fe4c19dc704eb6404f382dfee9 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1248,6 +1248,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++;
        }
@@ -1260,7 +1266,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;