]> granicus.if.org Git - neomutt/commitdiff
boolify parse functions
authorRichard Russon <rich@flatcap.org>
Sat, 14 Jul 2018 23:22:50 +0000 (00:22 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 16 Jul 2018 22:47:18 +0000 (23:47 +0100)
16 files changed:
buffy.c
email/parse.c
email/parse.h
email/rfc2231.c
imap/message.c
maildir/mh.c
main.c
mbox/mbox.c
mutt_header.c
mutt_url.c
nntp/nntp.c
pop/pop.c
postpone.c
protos.h
send.c
sendlib.c

diff --git a/buffy.c b/buffy.c
index 6cbfa1a3f58a0d777e96f301b4b4135b4aa1218d..810f21adad0b7658c3e77aa43886e2cc86dd2296 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -132,7 +132,7 @@ static bool test_last_status_new(FILE *f)
     return false;
 
   hdr = mutt_header_new();
-  tmp_envelope = mutt_rfc822_read_header(f, hdr, 0, 0);
+  tmp_envelope = mutt_rfc822_read_header(f, hdr, false, false);
   if (!(hdr->read || hdr->old))
     result = true;
 
index a4dcf138e00304cf7d6e6c38c3891401e86d9089..76864238d01deabc1148e89114e2662f728b0bcf 100644 (file)
@@ -489,9 +489,9 @@ void mutt_parse_content_type(char *s, struct Body *ct)
  * and the information put in the Envelope or Header.
  */
 int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
-                           char *p, short user_hdrs, short weed, short do_2047)
+                           char *p, bool user_hdrs, bool weed, bool do_2047)
 {
-  int matched = 0;
+  bool matched = false;
 
   switch (tolower(line[0]))
   {
@@ -499,12 +499,12 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       if (mutt_str_strcasecmp(line + 1, "pparently-to") == 0)
       {
         e->to = mutt_addr_parse_list(e->to, p);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "pparently-from") == 0)
       {
         e->from = mutt_addr_parse_list(e->from, p);
-        matched = 1;
+        matched = true;
       }
       break;
 
@@ -512,7 +512,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       if (mutt_str_strcasecmp(line + 1, "cc") == 0)
       {
         e->bcc = mutt_addr_parse_list(e->bcc, p);
-        matched = 1;
+        matched = true;
       }
       break;
 
@@ -520,7 +520,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       if (mutt_str_strcasecmp(line + 1, "c") == 0)
       {
         e->cc = mutt_addr_parse_list(e->cc, p);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strncasecmp(line + 1, "ontent-", 7) == 0)
       {
@@ -528,19 +528,19 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
         {
           if (hdr)
             mutt_parse_content_type(p, hdr->content);
-          matched = 1;
+          matched = true;
         }
         else if (mutt_str_strcasecmp(line + 8, "language") == 0)
         {
           if (hdr)
             parse_content_language(p, hdr->content);
-          matched = 1;
+          matched = true;
         }
         else if (mutt_str_strcasecmp(line + 8, "transfer-encoding") == 0)
         {
           if (hdr)
             hdr->content->encoding = mutt_check_encoding(p);
-          matched = 1;
+          matched = true;
         }
         else if (mutt_str_strcasecmp(line + 8, "length") == 0)
         {
@@ -550,7 +550,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
             if (hdr->content->length < 0)
               hdr->content->length = -1;
           }
-          matched = 1;
+          matched = true;
         }
         else if (mutt_str_strcasecmp(line + 8, "description") == 0)
         {
@@ -559,13 +559,13 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
             mutt_str_replace(&hdr->content->description, p);
             rfc2047_decode(&hdr->content->description);
           }
-          matched = 1;
+          matched = true;
         }
         else if (mutt_str_strcasecmp(line + 8, "disposition") == 0)
         {
           if (hdr)
             parse_content_disposition(p, hdr->content);
-          matched = 1;
+          matched = true;
         }
       }
       break;
@@ -585,7 +585,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
             hdr->zoccident = tz.zoccident;
           }
         }
-        matched = 1;
+        matched = true;
       }
       break;
 
@@ -601,7 +601,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       if (mutt_str_strcasecmp("rom", line + 1) == 0)
       {
         e->from = mutt_addr_parse_list(e->from, p);
-        matched = 1;
+        matched = true;
       }
 #ifdef USE_NNTP
       else if (mutt_str_strcasecmp(line + 1, "ollowup-to") == 0)
@@ -611,7 +611,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
           mutt_str_remove_trailing_ws(p);
           e->followup_to = mutt_str_strdup(mutt_str_skip_whitespace(p));
         }
-        matched = 1;
+        matched = true;
       }
 #endif
       break;
@@ -621,7 +621,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       {
         mutt_list_free(&e->in_reply_to);
         parse_references(&e->in_reply_to, p);
-        matched = 1;
+        matched = true;
       }
       break;
 
@@ -637,7 +637,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
             hdr->lines = 0;
         }
 
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "ist-Post") == 0)
       {
@@ -661,7 +661,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
             }
           }
         }
-        matched = 1;
+        matched = true;
       }
       break;
 
@@ -670,14 +670,14 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       {
         if (hdr)
           hdr->mime = true;
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "essage-id") == 0)
       {
         /* We add a new "Message-ID:" when building a message */
         FREE(&e->message_id);
         e->message_id = mutt_extract_message_id(p, NULL);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strncasecmp(line + 1, "ail-", 4) == 0)
       {
@@ -686,12 +686,12 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
           /* override the Reply-To: field */
           mutt_addr_free(&e->reply_to);
           e->reply_to = mutt_addr_parse_list(e->reply_to, p);
-          matched = 1;
+          matched = true;
         }
         else if (mutt_str_strcasecmp(line + 5, "followup-to") == 0)
         {
           e->mail_followup_to = mutt_addr_parse_list(e->mail_followup_to, p);
-          matched = 1;
+          matched = true;
         }
       }
       break;
@@ -703,7 +703,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
         FREE(&e->newsgroups);
         mutt_str_remove_trailing_ws(p);
         e->newsgroups = mutt_str_strdup(mutt_str_skip_whitespace(p));
-        matched = 1;
+        matched = true;
       }
       break;
 #endif
@@ -722,17 +722,17 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       {
         mutt_list_free(&e->references);
         parse_references(&e->references, p);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "eply-to") == 0)
       {
         e->reply_to = mutt_addr_parse_list(e->reply_to, p);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "eturn-path") == 0)
       {
         e->return_path = mutt_addr_parse_list(e->return_path, p);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "eceived") == 0)
       {
@@ -751,12 +751,12 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       {
         if (!e->subject)
           e->subject = mutt_str_strdup(p);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "ender") == 0)
       {
         e->sender = mutt_addr_parse_list(e->sender, p);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "tatus") == 0)
       {
@@ -779,7 +779,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
             p++;
           }
         }
-        matched = 1;
+        matched = true;
       }
       else if (((mutt_str_strcasecmp("upersedes", line + 1) == 0) ||
                 (mutt_str_strcasecmp("upercedes", line + 1) == 0)) &&
@@ -794,7 +794,7 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
       if (mutt_str_strcasecmp(line + 1, "o") == 0)
       {
         e->to = mutt_addr_parse_list(e->to, p);
-        matched = 1;
+        matched = true;
       }
       break;
 
@@ -822,32 +822,32 @@ int mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line,
             p++;
           }
         }
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "-label") == 0)
       {
         FREE(&e->x_label);
         e->x_label = mutt_str_strdup(p);
-        matched = 1;
+        matched = true;
       }
 #ifdef USE_NNTP
       else if (mutt_str_strcasecmp(line + 1, "-comment-to") == 0)
       {
         if (!e->x_comment_to)
           e->x_comment_to = mutt_str_strdup(p);
-        matched = 1;
+        matched = true;
       }
       else if (mutt_str_strcasecmp(line + 1, "ref") == 0)
       {
         if (!e->xref)
           e->xref = mutt_str_strdup(p);
-        matched = 1;
+        matched = true;
       }
 #endif
       else if (mutt_str_strcasecmp(line + 1, "-original-to") == 0)
       {
         e->x_original_to = mutt_addr_parse_list(e->x_original_to, p);
-        matched = 1;
+        matched = true;
       }
 
     default:
@@ -954,7 +954,7 @@ char *mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen)
  * Caller should free the Envelope using mutt_env_free().
  */
 struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr,
-                                         short user_hdrs, short weed)
+                                         bool user_hdrs, bool weed)
 {
   struct Envelope *e = mutt_env_new();
   char *line = mutt_mem_malloc(LONG_STRING);
@@ -1053,7 +1053,7 @@ struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr,
     if (!*p)
       continue; /* skip empty header fields */
 
-    mutt_rfc822_parse_line(e, hdr, line, p, user_hdrs, weed, 1);
+    mutt_rfc822_parse_line(e, hdr, line, p, user_hdrs, weed, true);
   }
 
   FREE(&line);
@@ -1367,7 +1367,7 @@ struct Body *mutt_rfc822_parse_message(FILE *fp, struct Body *parent)
 {
   parent->hdr = mutt_header_new();
   parent->hdr->offset = ftello(fp);
-  parent->hdr->env = mutt_rfc822_read_header(fp, parent->hdr, 0, 0);
+  parent->hdr->env = mutt_rfc822_read_header(fp, parent->hdr, false, false);
   struct Body *msg = parent->hdr->content;
 
   /* ignore the length given in the content-length since it could be wrong
index df36d1092bbee3f7287810afb58c6b6563edd4eb..4015f89e51dd368dc4e2c6e3263547f204fc1691 100644 (file)
@@ -38,9 +38,9 @@ void             mutt_parse_content_type(char *s, struct Body *ct);
 struct Body *    mutt_parse_multipart(FILE *fp, const char *boundary, LOFF_T end_off, bool digest);
 void             mutt_parse_part(FILE *fp, struct Body *b);
 struct Body *    mutt_read_mime_header(FILE *fp, bool digest);
-int              mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line, char *p, short user_hdrs, short weed, short do_2047);
+int              mutt_rfc822_parse_line(struct Envelope *e, struct Header *hdr, char *line, char *p, bool user_hdrs, bool weed, bool do_2047);
 struct Body *    mutt_rfc822_parse_message(FILE *fp, struct Body *parent);
-struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, short user_hdrs, short weed);
+struct Envelope *mutt_rfc822_read_header(FILE *f, struct Header *hdr, bool user_hdrs, bool weed);
 char *           mutt_rfc822_read_line(FILE *f, char *line, size_t *linelen);
 
 #endif /* _EMAIL_PARSE_H */
index 6418b0e107eebad5a49c9ff328e40df0d3adcdce..87b3fda3a420714555aff3271543f0f4218548e7 100644 (file)
@@ -321,7 +321,8 @@ void rfc2231_decode_parameters(struct ParameterList *p)
  */
 int rfc2231_encode_string(char **pd)
 {
-  int ext = 0, encode = 0;
+  int ext = 0;
+  bool encode = false;
   char *charset = NULL, *s = NULL, *t = NULL, *e = NULL, *d = NULL;
   size_t slen, dlen = 0;
 
@@ -346,13 +347,13 @@ int rfc2231_encode_string(char **pd)
   }
 
   if (!mutt_ch_is_us_ascii(charset))
-    encode = 1;
+    encode = true;
 
   for (s = d, slen = dlen; slen; s++, slen--)
   {
     if ((*s < 0x20) || (*s >= 0x7f))
     {
-      encode = 1;
+      encode = true;
       ext++;
     }
     else if (strchr(MimeSpecials, *s) || strchr("*'%", *s))
index 878ec75c88ffc7a3a031faa0b310c14a10665745..027ed2920c0dae243a8af101050cb164a6c2d714 100644 (file)
@@ -880,7 +880,7 @@ int imap_read_headers(struct ImapData *idata, unsigned int msn_begin, unsigned i
         rewind(fp);
         /* NOTE: if Date: header is missing, mutt_rfc822_read_header depends
          *   on h.received being set */
-        ctx->hdrs[idx]->env = mutt_rfc822_read_header(fp, ctx->hdrs[idx], 0, 0);
+        ctx->hdrs[idx]->env = mutt_rfc822_read_header(fp, ctx->hdrs[idx], false, false);
         /* content built as a side-effect of mutt_rfc822_read_header */
         ctx->hdrs[idx]->content->length = h.content_length;
         ctx->size += h.content_length;
@@ -1152,7 +1152,7 @@ parsemsg:
    * picked up in mutt_rfc822_read_header, we mark the message (and context
    * changed). Another possibility: ignore Status on IMAP? */
   read = h->read;
-  newenv = mutt_rfc822_read_header(msg->fp, h, 0, 0);
+  newenv = mutt_rfc822_read_header(msg->fp, h, false, false);
   mutt_env_merge(h->env, &newenv);
 
   /* see above. We want the new status in h->read, so we unset it manually
index 7bdead18d0d5033d872b1369f601b8c4b2cb6ea4..a8b0785440ba07a1f54632a4fe178ade38bd62f7 100644 (file)
@@ -890,7 +890,7 @@ struct Header *maildir_parse_stream(int magic, FILE *f, const char *fname,
 
   if (!h)
     h = mutt_header_new();
-  h->env = mutt_rfc822_read_header(f, h, 0, 0);
+  h->env = mutt_rfc822_read_header(f, h, false, false);
 
   fstat(fileno(f), &st);
 
diff --git a/main.c b/main.c
index a22beafda78e016830f2677b7cb3f805a55a7917..d608d6232f2ac9b1fbca112f4a5b225bad8ad757 100644 (file)
--- a/main.c
+++ b/main.c
@@ -863,7 +863,7 @@ int main(int argc, char *argv[], char *envp[])
         }
         context_hdr->content->length = st.st_size;
 
-        if (mutt_prepare_template(fin, NULL, msg, context_hdr, 0) < 0)
+        if (mutt_prepare_template(fin, NULL, msg, context_hdr, false) < 0)
         {
           mutt_error(_("Cannot parse message template: %s"), draft_file);
           mutt_env_free(&opts_env);
index a51124f66a84438ec4fb174a517436d9df3313c1..3581c179f4b6caa6cc2338e4e9cb462a6ebeac31 100644 (file)
@@ -188,7 +188,7 @@ static int mmdf_parse_mailbox(struct Context *ctx)
       else
         hdr->received = t - mutt_date_local_tz(t);
 
-      hdr->env = mutt_rfc822_read_header(ctx->fp, hdr, 0, 0);
+      hdr->env = mutt_rfc822_read_header(ctx->fp, hdr, false, false);
 
       loc = ftello(ctx->fp);
       if (loc < 0)
@@ -335,7 +335,7 @@ static int mbox_parse_mailbox(struct Context *ctx)
       curhdr->offset = loc;
       curhdr->index = ctx->msgcount;
 
-      curhdr->env = mutt_rfc822_read_header(ctx->fp, curhdr, 0, 0);
+      curhdr->env = mutt_rfc822_read_header(ctx->fp, curhdr, false, false);
 
       /* if we know how long this message is, either just skip over the body,
        * or if we don't know how many lines there are, count them now (this will
index 45ab8a69453efe0e6ad847347e3d9e8bfdf86510..20d0978424095865787221f2eadf7ab0e55d6240 100644 (file)
@@ -222,7 +222,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Header *msg,
     return;
   }
 
-  n = mutt_rfc822_read_header(ifp, NULL, 1, 0);
+  n = mutt_rfc822_read_header(ifp, NULL, true, false);
   while ((i = fread(buffer, 1, sizeof(buffer), ifp)) > 0)
     fwrite(buffer, 1, i, ofp);
   mutt_file_fclose(&ofp);
index eabdd46cd742bd6d4a0901fd0492971714570900..e29c14ac07c3664d15306be494db2b50ce3c49e4 100644 (file)
@@ -95,7 +95,7 @@ int url_parse_mailto(struct Envelope *e, char **body, const char *src)
         safe_asprintf(&scratch, "%s: %s", tag, value);
         scratch[taglen] = 0; /* overwrite the colon as mutt_rfc822_parse_line expects */
         value = mutt_str_skip_email_wsp(&scratch[taglen + 1]);
-        mutt_rfc822_parse_line(e, NULL, scratch, value, 1, 0, 1);
+        mutt_rfc822_parse_line(e, NULL, scratch, value, true, false, true);
         FREE(&scratch);
       }
     }
index 4214f7db66c9e03e7fc5f41a80d020744510d36c..1890b8f685fc61c1d976f8e5b0ac52e3e305fda1 100644 (file)
@@ -1191,7 +1191,7 @@ static int parse_overview_line(char *line, void *data)
 
   /* parse header */
   hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new();
-  hdr->env = mutt_rfc822_read_header(fp, hdr, 0, 0);
+  hdr->env = mutt_rfc822_read_header(fp, hdr, false, false);
   hdr->env->newsgroups = mutt_str_strdup(nntp_data->group);
   hdr->received = hdr->date_sent;
   mutt_file_fclose(&fp);
@@ -1451,7 +1451,7 @@ static int nntp_fetch_headers(struct Context *ctx, void *hc, anum_t first,
 
       /* parse header */
       hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new();
-      hdr->env = mutt_rfc822_read_header(fp, hdr, 0, 0);
+      hdr->env = mutt_rfc822_read_header(fp, hdr, false, false);
       hdr->received = hdr->date_sent;
       mutt_file_fclose(&fp);
     }
@@ -1732,7 +1732,7 @@ static int nntp_msg_open(struct Context *ctx, struct Message *msg, int msgno)
     mutt_hash_delete(ctx->subj_hash, hdr->env->real_subj, hdr);
 
   mutt_env_free(&hdr->env);
-  hdr->env = mutt_rfc822_read_header(msg->fp, hdr, 0, 0);
+  hdr->env = mutt_rfc822_read_header(msg->fp, hdr, false, false);
 
   if (ctx->id_hash && hdr->env->message_id)
     mutt_hash_insert(ctx->id_hash, hdr->env->message_id, hdr);
@@ -2475,7 +2475,7 @@ int nntp_check_msgid(struct Context *ctx, const char *msgid)
     mx_alloc_memory(ctx);
   struct Header *hdr = ctx->hdrs[ctx->msgcount] = mutt_header_new();
   hdr->data = mutt_mem_calloc(1, sizeof(struct NntpHeaderData));
-  hdr->env = mutt_rfc822_read_header(fp, hdr, 0, 0);
+  hdr->env = mutt_rfc822_read_header(fp, hdr, false, false);
   mutt_file_fclose(&fp);
 
   /* get article number */
index d096ea094005d773988d8167c89c9494e30657e0..a2d7993ed05df5507f2918e64e27587a3c48e854 100644 (file)
--- a/pop/pop.c
+++ b/pop/pop.c
@@ -164,7 +164,7 @@ static int pop_read_header(struct PopData *pop_data, struct Header *h)
     case 0:
     {
       rewind(f);
-      h->env = mutt_rfc822_read_header(f, h, 0, 0);
+      h->env = mutt_rfc822_read_header(f, h, false, false);
       h->content->length = length - h->content->offset + 1;
       rewind(f);
       while (!feof(f))
@@ -734,7 +734,7 @@ static int pop_msg_open(struct Context *ctx, struct Message *msg, int msgno)
     mutt_hash_delete(ctx->subj_hash, h->env->real_subj, h);
   mutt_label_hash_remove(ctx, h);
   mutt_env_free(&h->env);
-  h->env = mutt_rfc822_read_header(msg->fp, h, 0, 0);
+  h->env = mutt_rfc822_read_header(msg->fp, h, false, false);
   if (ctx->subj_hash && h->env->real_subj)
     mutt_hash_insert(ctx->subj_hash, h->env->real_subj, h);
   mutt_label_hash_add(ctx, h);
index c08ad79d2953b683a37da7e994d261cb26cfb177..3c9d03ee4ff673dad9369c9a5bd1d21470bb2323 100644 (file)
@@ -319,7 +319,7 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr,
     return -1;
   }
 
-  if (mutt_prepare_template(NULL, PostContext, hdr, h, 0) < 0)
+  if (mutt_prepare_template(NULL, PostContext, hdr, h, false) < 0)
   {
     mx_fastclose_mailbox(PostContext);
     FREE(&PostContext);
@@ -559,7 +559,7 @@ int mutt_parse_crypt_hdr(const char *p, int set_empty_signas, int crypt_app)
  * @retval -1 Error
  */
 int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr,
-                          struct Header *hdr, short resend)
+                          struct Header *hdr, bool resend)
 {
   struct Message *msg = NULL;
   char file[PATH_MAX];
@@ -582,7 +582,7 @@ int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr,
   fseeko(fp, hdr->offset, SEEK_SET);
   newhdr->offset = hdr->offset;
   /* enable header weeding for resent messages */
-  newhdr->env = mutt_rfc822_read_header(fp, newhdr, 1, resend);
+  newhdr->env = mutt_rfc822_read_header(fp, newhdr, true, resend);
   newhdr->content->length = hdr->content->length;
   mutt_parse_part(fp, newhdr->content);
 
index fca4081e36485bdb124b5d3273a16f9c288f6dec..f9bfedeaca8aa1e90ce3dafe4f3c42e195534ba7 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -57,7 +57,7 @@ int mutt_change_flag(struct Header *h, int bf);
 int mutt_complete(char *buf, size_t buflen);
 int mutt_edit_message(struct Context *ctx, struct Header *hdr);
 int mutt_view_message(struct Context *ctx, struct Header *hdr);
-int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, struct Header *hdr, short resend);
+int mutt_prepare_template(FILE *fp, struct Context *ctx, struct Header *newhdr, struct Header *hdr, bool resend);
 int mutt_enter_string(char *buf, size_t buflen, int col, int flags);
 int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int multiple,
                        char ***files, int *numfiles, struct EnterState *state);
diff --git a/send.c b/send.c
index 7a47609456603ecadfffd907b337bd1b59f07a6a..e53ca11d8e55e85684fdf640d9a211292ef6bb28 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1298,7 +1298,7 @@ int mutt_resend_message(FILE *fp, struct Context *ctx, struct Header *cur)
 {
   struct Header *msg = mutt_header_new();
 
-  if (mutt_prepare_template(fp, ctx, msg, cur, 1) < 0)
+  if (mutt_prepare_template(fp, ctx, msg, cur, true) < 0)
   {
     mutt_header_free(&msg);
     return -1;
index 21a9723d9bdabd3b4669ff6c9a7597a995664632..6d66cff8b94e4df0def2ad76032013cea1031925 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1509,7 +1509,7 @@ struct Body *mutt_make_message_attach(struct Context *ctx, struct Header *hdr, b
   body->hdr = mutt_header_new();
   body->hdr->offset = 0;
   /* we don't need the user headers here */
-  body->hdr->env = mutt_rfc822_read_header(fp, body->hdr, 0, 0);
+  body->hdr->env = mutt_rfc822_read_header(fp, body->hdr, false, false);
   if (WithCrypto)
     body->hdr->security = pgp;
   mutt_update_encoding(body);