]> granicus.if.org Git - neomutt/commitdiff
Unify `body_new` name instances
authorFederico Kircheis <federico.kircheis@gmail.com>
Wed, 3 Jul 2019 19:04:19 +0000 (21:04 +0200)
committerRichard Russon <rich@flatcap.org>
Fri, 5 Jul 2019 01:34:06 +0000 (02:34 +0100)
`new` is a reserved keyword in c++
Most instances are named this way

email/parse.c
sendlib.c

index bc0193e7effd9c73bd8121a0b61b82efe5ad0032..4e024c1ef8e063e6260fda550616c9db9a61c692 100644 (file)
@@ -1350,7 +1350,7 @@ struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off
   }
 
   char buf[1024];
-  struct Body *head = NULL, *last = NULL, *new = NULL;
+  struct Body *head = NULL, *last = NULL, *new_body = NULL;
   bool final = false; /* did we see the ending boundary? */
 
   const size_t blen = mutt_str_strlen(boundary);
@@ -1387,13 +1387,14 @@ struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off
       }
       else if (buf[2 + blen] == '\0')
       {
-        new = mutt_read_mime_header(fp, digest);
+        new_body = mutt_read_mime_header(fp, digest);
 
 #ifdef SUN_ATTACHMENT
-        if (mutt_param_get(&new->parameter, "content-lines"))
+        if (mutt_param_get(&new_body->parameter, "content-lines"))
         {
           int lines = 0;
-          if (mutt_str_atoi(mutt_param_get(&new->parameter, "content-lines"), &lines) < 0)
+          if (mutt_str_atoi(
+                  mutt_param_get(&new_body->parameter, "content-lines"), &lines) < 0)
             lines = 0;
           for (; lines > 0; lines--)
             if ((ftello(fp) >= end_off) || !fgets(buf, sizeof(buf), fp))
@@ -1401,20 +1402,20 @@ struct Body *mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off
         }
 #endif
         /* Consistency checking - catch bad attachment end boundaries */
-        if (new->offset > end_off)
+        if (new_body->offset > end_off)
         {
-          mutt_body_free(&new);
+          mutt_body_free(&new_body);
           break;
         }
         if (head)
         {
-          last->next = new;
-          last = new;
+          last->next = new_body;
+          last = new_body;
         }
         else
         {
-          last = new;
-          head = new;
+          last = new_body;
+          head = new_body;
         }
       }
     }
index 30008ad5803e7bb8eaf066418af69e48d1b1292b..a1adafd78954218de799c28c572202156f3a895d 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1705,21 +1705,21 @@ static bool check_boundary(const char *boundary, struct Body *b)
  */
 struct Body *mutt_make_multipart(struct Body *b)
 {
-  struct Body *new = mutt_body_new();
-  new->type = TYPE_MULTIPART;
-  new->subtype = mutt_str_strdup("mixed");
-  new->encoding = get_toplevel_encoding(b);
+  struct Body *new_body = mutt_body_new();
+  new_body->type = TYPE_MULTIPART;
+  new_body->subtype = mutt_str_strdup("mixed");
+  new_body->encoding = get_toplevel_encoding(b);
   do
   {
-    mutt_generate_boundary(&new->parameter);
-    if (check_boundary(mutt_param_get(&new->parameter, "boundary"), b))
-      mutt_param_delete(&new->parameter, "boundary");
-  } while (!mutt_param_get(&new->parameter, "boundary"));
-  new->use_disp = false;
-  new->disposition = DISP_INLINE;
-  new->parts = b;
+    mutt_generate_boundary(&new_body->parameter);
+    if (check_boundary(mutt_param_get(&new_body->parameter, "boundary"), b))
+      mutt_param_delete(&new_body->parameter, "boundary");
+  } while (!mutt_param_get(&new_body->parameter, "boundary"));
+  new_body->use_disp = false;
+  new_body->disposition = DISP_INLINE;
+  new_body->parts = b;
 
-  return new;
+  return new_body;
 }
 
 /**