From: Federico Kircheis Date: Wed, 3 Jul 2019 19:04:19 +0000 (+0200) Subject: Unify `body_new` name instances X-Git-Tag: 2019-10-25~149^2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b169a3ace813b5f3003978cbd21a89f0439e9b9;p=neomutt Unify `body_new` name instances `new` is a reserved keyword in c++ Most instances are named this way --- diff --git a/email/parse.c b/email/parse.c index bc0193e7e..4e024c1ef 100644 --- a/email/parse.c +++ b/email/parse.c @@ -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; } } } diff --git a/sendlib.c b/sendlib.c index 30008ad58..a1adafd78 100644 --- 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; } /**