]> granicus.if.org Git - neomutt/commitdiff
tidy code
authorRichard Russon <rich@flatcap.org>
Wed, 17 Feb 2016 19:54:01 +0000 (19:54 +0000)
committerRichard Russon <rich@flatcap.org>
Mon, 4 Apr 2016 02:33:38 +0000 (03:33 +0100)
muttlib.c

index f5b60d8a5631aa154bd4199e844121b73e20d4c2..55056357e41e7d43b6e48466163c21cdb0f54221 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1215,14 +1215,18 @@ void mutt_FormatString (char *dest,             /* output buffer */
       {
        /* change original %? to new %< notation */
        /* %?x?y&z? to %<x?y&z> where y and z are nestable */
-       char *p = (char *)src;
+       char *p = (char *) src;
        *p = '<';
        for ( ; *p && *p != '?'; p++);
-       if (*p == '?')
+         /* nothing */
+       if (*p == '?') {
          p++;
+       }
        for ( ; *p && *p != '?'; p++);
-       if (*p == '?')
+         /* nothing */
+       if (*p == '?') {
          *p = '>';
+       }
       }
 
       if (*src == '<')
@@ -1263,20 +1267,18 @@ void mutt_FormatString (char *dest,             /* output buffer */
         cp = ifstring;
        count = 0;
        lrbalance = 1;
-        while (lrbalance > 0 && count < sizeof (ifstring) && *src)
-       {
-         if (*src == '\\')
-         {
+        while ((lrbalance > 0) && (count < sizeof (ifstring)) && *src) {
+         if (*src == '\\') {
            src++;
            *cp++ = *src++;
-         }
-         else if (src[0] == '%' && src[1] == '<')
+         } else if ((src[0] == '%') && (src[1] == '<')) {
            lrbalance++;
-         else if (src[0] == '>')
+         } else if (src[0] == '>') {
            lrbalance--;
+         }
          if (lrbalance == 0)
            break;
-         if (lrbalance == 1 && src[0] == '&')
+         if ((lrbalance == 1) && (src[0] == '&'))
            break;
           *cp++ = *src++;
          count++;
@@ -1288,20 +1290,18 @@ void mutt_FormatString (char *dest,             /* output buffer */
          src++; /* skip the & */
        cp = elsestring;
        count = 0;
-       while (lrbalance > 0 && count < sizeof (elsestring) && *src)
-       {
-         if (*src == '\\')
-         {
+       while ((lrbalance > 0) && (count < sizeof (elsestring)) && *src) {
+         if (*src == '\\') {
            src++;
            *cp++ = *src++;
-         }
-         else if (src[0] == '%' && src[1] == '<')
+         } else if ((src[0] == '%') && (src[1] == '<')) {
            lrbalance++;
-         else if (src[0] == '>')
+         } else if (src[0] == '>') {
            lrbalance--;
+         }
          if (lrbalance == 0)
            break;
-         if (lrbalance == 1 && src[0] == '&')
+         if ((lrbalance == 1) && (src[0] == '&'))
            break;
           *cp++ = *src++;
          count++;