* @param out FILE pointer to write to
* @param off_start Offset to start from
* @param off_end Offset to finish at
- * @param flags Flags (see below)
+ * @param chflags Flags (see below)
* @param prefix Prefix for quoting headers
* @retval 0 Success
* @retval -1 Failure
* wrap headers much more aggressively than the other one.
*/
int mutt_copy_hdr(FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end,
- int flags, const char *prefix)
+ int chflags, const char *prefix)
{
bool from = false;
bool this_is_from = false;
buf[0] = '\n';
buf[1] = '\0';
- if ((flags & (CH_REORDER | CH_WEED | CH_MIME | CH_DECODE | CH_PREFIX | CH_WEED_DELIVERED)) == 0)
+ if ((chflags & (CH_REORDER | CH_WEED | CH_MIME | CH_DECODE | CH_PREFIX | CH_WEED_DELIVERED)) == 0)
{
/* Without these flags to complicate things
* we can do a more efficient line to line copying
ignore = true;
if (!from && mutt_str_startswith(buf, "From ", CASE_MATCH))
{
- if ((flags & CH_FROM) == 0)
+ if ((chflags & CH_FROM) == 0)
continue;
from = true;
}
- else if ((flags & CH_NOQFROM) && mutt_str_startswith(buf, ">From ", CASE_IGNORE))
+ else if ((chflags & CH_NOQFROM) && mutt_str_startswith(buf, ">From ", CASE_IGNORE))
continue;
else if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n'))
break; /* end of header */
- if ((flags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) &&
+ if ((chflags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) &&
(mutt_str_startswith(buf, "Status:", CASE_IGNORE) ||
mutt_str_startswith(buf, "X-Status:", CASE_IGNORE)))
{
continue;
}
- if ((flags & (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) &&
+ if ((chflags & (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) &&
(mutt_str_startswith(buf, "Content-Length:", CASE_IGNORE) ||
mutt_str_startswith(buf, "Lines:", CASE_IGNORE)))
{
continue;
}
- if ((flags & CH_UPDATE_REFS) && mutt_str_startswith(buf, "References:", CASE_IGNORE))
+ if ((chflags & CH_UPDATE_REFS) && mutt_str_startswith(buf, "References:", CASE_IGNORE))
continue;
- if ((flags & CH_UPDATE_IRT) && mutt_str_startswith(buf, "In-Reply-To:", CASE_IGNORE))
+ if ((chflags & CH_UPDATE_IRT) && mutt_str_startswith(buf, "In-Reply-To:", CASE_IGNORE))
continue;
- if (flags & CH_UPDATE_LABEL && mutt_str_startswith(buf, "X-Label:", CASE_IGNORE))
+ if (chflags & CH_UPDATE_LABEL && mutt_str_startswith(buf, "X-Label:", CASE_IGNORE))
continue;
- if ((flags & CH_UPDATE_SUBJECT) && mutt_str_startswith(buf, "Subject:", CASE_IGNORE))
+ if ((chflags & CH_UPDATE_SUBJECT) && mutt_str_startswith(buf, "Subject:", CASE_IGNORE))
continue;
ignore = false;
* so we are able to do re-ordering.
* First count the number of entries in the array
*/
- if (flags & CH_REORDER)
+ if (chflags & CH_REORDER)
{
struct ListNode *np = NULL;
STAILQ_FOREACH(np, &HeaderOrderList, entries)
}
}
- mutt_debug(LL_DEBUG1, "WEED is %s\n", (flags & CH_WEED) ? "Set" : "Not");
+ mutt_debug(LL_DEBUG1, "WEED is %s\n", (chflags & CH_WEED) ? "Set" : "Not");
headers = mutt_mem_calloc(hdr_count, sizeof(char *));
/* Do we have anything pending? */
if (this_one)
{
- if (flags & CH_DECODE)
+ if (chflags & CH_DECODE)
{
if (address_header_decode(&this_one) == 0)
rfc2047_decode(&this_one);
this_is_from = false;
if (!from && mutt_str_startswith(buf, "From ", CASE_MATCH))
{
- if ((flags & CH_FROM) == 0)
+ if ((chflags & CH_FROM) == 0)
continue;
this_is_from = true;
from = true;
break; /* end of header */
/* note: CH_FROM takes precedence over header weeding. */
- if (!((flags & CH_FROM) && (flags & CH_FORCE_FROM) && this_is_from) &&
- (flags & CH_WEED) && mutt_matches_ignore(buf))
+ if (!((chflags & CH_FROM) && (chflags & CH_FORCE_FROM) && this_is_from) &&
+ (chflags & CH_WEED) && mutt_matches_ignore(buf))
{
continue;
}
- if ((flags & CH_WEED_DELIVERED) && mutt_str_startswith(buf, "Delivered-To:", CASE_IGNORE))
+ if ((chflags & CH_WEED_DELIVERED) && mutt_str_startswith(buf, "Delivered-To:", CASE_IGNORE))
{
continue;
}
- if ((flags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) &&
+ if ((chflags & (CH_UPDATE | CH_XMIT | CH_NOSTATUS)) &&
(mutt_str_startswith(buf, "Status:", CASE_IGNORE) ||
mutt_str_startswith(buf, "X-Status:", CASE_IGNORE)))
{
continue;
}
- if ((flags & (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) &&
+ if ((chflags & (CH_UPDATE_LEN | CH_XMIT | CH_NOLEN)) &&
(mutt_str_startswith(buf, "Content-Length:", CASE_IGNORE) ||
mutt_str_startswith(buf, "Lines:", CASE_IGNORE)))
{
continue;
}
- if ((flags & CH_MIME))
+ if ((chflags & CH_MIME))
{
if (mutt_str_startswith(buf, "mime-version:", CASE_IGNORE))
{
continue;
}
}
- if ((flags & CH_UPDATE_REFS) && mutt_str_startswith(buf, "References:", CASE_IGNORE))
+ if ((chflags & CH_UPDATE_REFS) && mutt_str_startswith(buf, "References:", CASE_IGNORE))
continue;
- if ((flags & CH_UPDATE_IRT) && mutt_str_startswith(buf, "In-Reply-To:", CASE_IGNORE))
+ if ((chflags & CH_UPDATE_IRT) && mutt_str_startswith(buf, "In-Reply-To:", CASE_IGNORE))
continue;
- if ((flags & CH_UPDATE_LABEL) && mutt_str_startswith(buf, "X-Label:", CASE_IGNORE))
+ if ((chflags & CH_UPDATE_LABEL) && mutt_str_startswith(buf, "X-Label:", CASE_IGNORE))
continue;
- if ((flags & CH_UPDATE_SUBJECT) && mutt_str_startswith(buf, "Subject:", CASE_IGNORE))
+ if ((chflags & CH_UPDATE_SUBJECT) && mutt_str_startswith(buf, "Subject:", CASE_IGNORE))
continue;
/* Find x -- the array entry where this header is to be saved */
- if (flags & CH_REORDER)
+ if (chflags & CH_REORDER)
{
struct ListNode *np = NULL;
x = 0;
/* Do we have anything pending? -- XXX, same code as in above in the loop. */
if (this_one)
{
- if (flags & CH_DECODE)
+ if (chflags & CH_DECODE)
{
if (address_header_decode(&this_one) == 0)
rfc2047_decode(&this_one);
* decoding may have concatenated lines.
*/
- if (flags & (CH_DECODE | CH_PREFIX))
+ if (chflags & (CH_DECODE | CH_PREFIX))
{
- if (mutt_write_one_header(out, 0, headers[x], (flags & CH_PREFIX) ? prefix : 0,
- mutt_window_wrap_cols(MuttIndexWindow, Wrap), flags) == -1)
+ if (mutt_write_one_header(out, 0, headers[x], (chflags & CH_PREFIX) ? prefix : 0,
+ mutt_window_wrap_cols(MuttIndexWindow, Wrap), chflags) == -1)
{
error = true;
break;
/**
* mutt_copy_header - Copy Email header
- * @param in FILE pointer to read from
- * @param e Email
- * @param out FILE pointer to write to
- * @param flags Flags, e.g. #CH_DECODE
- * @param prefix Prefix for quoting headers (if #CH_PREFIX is set)
+ * @param in FILE pointer to read from
+ * @param e Email
+ * @param out FILE pointer to write to
+ * @param chflags Flags, e.g. #CH_DECODE
+ * @param prefix Prefix for quoting headers (if #CH_PREFIX is set)
* @retval 0 Success
* @retval -1 Failure
*/
-int mutt_copy_header(FILE *in, struct Email *e, FILE *out, int flags, const char *prefix)
+int mutt_copy_header(FILE *in, struct Email *e, FILE *out, int chflags, const char *prefix)
{
char *temp_hdr = NULL;
if (e->env)
{
- flags |= ((e->env->changed & MUTT_ENV_CHANGED_IRT) ? CH_UPDATE_IRT : 0) |
+ chflags |= ((e->env->changed & MUTT_ENV_CHANGED_IRT) ? CH_UPDATE_IRT : 0) |
((e->env->changed & MUTT_ENV_CHANGED_REFS) ? CH_UPDATE_REFS : 0) |
((e->env->changed & MUTT_ENV_CHANGED_XLABEL) ? CH_UPDATE_LABEL : 0) |
((e->env->changed & MUTT_ENV_CHANGED_SUBJECT) ? CH_UPDATE_SUBJECT : 0);
}
- if (mutt_copy_hdr(in, out, e->offset, e->content->offset, flags, prefix) == -1)
+ if (mutt_copy_hdr(in, out, e->offset, e->content->offset, chflags, prefix) == -1)
return -1;
- if (flags & CH_TXTPLAIN)
+ if (chflags & CH_TXTPLAIN)
{
char chsbuf[SHORT_STRING];
char buffer[SHORT_STRING];
fputc('\n', out);
}
- if ((flags & CH_UPDATE_IRT) && !STAILQ_EMPTY(&e->env->in_reply_to))
+ if ((chflags & CH_UPDATE_IRT) && !STAILQ_EMPTY(&e->env->in_reply_to))
{
fputs("In-Reply-To:", out);
struct ListNode *np = NULL;
fputc('\n', out);
}
- if ((flags & CH_UPDATE_REFS) && !STAILQ_EMPTY(&e->env->references))
+ if ((chflags & CH_UPDATE_REFS) && !STAILQ_EMPTY(&e->env->references))
{
fputs("References:", out);
mutt_write_references(&e->env->references, out, 0);
fputc('\n', out);
}
- if ((flags & CH_UPDATE) && (flags & CH_NOSTATUS) == 0)
+ if ((chflags & CH_UPDATE) && (chflags & CH_NOSTATUS) == 0)
{
if (e->old || e->read)
{
}
}
- if (flags & CH_UPDATE_LEN && (flags & CH_NOLEN) == 0)
+ if (chflags & CH_UPDATE_LEN && (chflags & CH_NOLEN) == 0)
{
fprintf(out, "Content-Length: " OFF_T_FMT "\n", e->content->length);
if (e->lines != 0 || e->content->length == 0)
}
#ifdef USE_NOTMUCH
- if (flags & CH_VIRTUAL)
+ if (chflags & CH_VIRTUAL)
{
/* Add some fake headers based on notmuch data */
char *folder = nm_email_get_folder(e);
}
FREE(&tags);
- if ((flags & CH_UPDATE_LABEL) && e->env->x_label)
+ if ((chflags & CH_UPDATE_LABEL) && e->env->x_label)
{
temp_hdr = e->env->x_label;
/* env->x_label isn't currently stored with direct references elsewhere.
* Context->label_hash strdups the keys. But to be safe, encode a copy */
- if (!(flags & CH_DECODE))
+ if (!(chflags & CH_DECODE))
{
temp_hdr = mutt_str_strdup(temp_hdr);
rfc2047_encode(&temp_hdr, NULL, sizeof("X-Label:"), SendCharset);
}
- if (mutt_write_one_header(out, "X-Label", temp_hdr, flags & CH_PREFIX ? prefix : 0,
- mutt_window_wrap_cols(MuttIndexWindow, Wrap), flags) == -1)
+ if (mutt_write_one_header(out, "X-Label", temp_hdr, chflags & CH_PREFIX ? prefix : 0,
+ mutt_window_wrap_cols(MuttIndexWindow, Wrap), chflags) == -1)
{
return -1;
}
- if (!(flags & CH_DECODE))
+ if (!(chflags & CH_DECODE))
FREE(&temp_hdr);
}
- if ((flags & CH_UPDATE_SUBJECT) && e->env->subject)
+ if ((chflags & CH_UPDATE_SUBJECT) && e->env->subject)
{
temp_hdr = e->env->subject;
/* env->subject is directly referenced in Context->subj_hash, so we
* have to be careful not to encode (and thus free) that memory. */
- if (!(flags & CH_DECODE))
+ if (!(chflags & CH_DECODE))
{
temp_hdr = mutt_str_strdup(temp_hdr);
rfc2047_encode(&temp_hdr, NULL, sizeof("Subject:"), SendCharset);
}
- if (mutt_write_one_header(out, "Subject", temp_hdr, flags & CH_PREFIX ? prefix : 0,
- mutt_window_wrap_cols(MuttIndexWindow, Wrap), flags) == -1)
+ if (mutt_write_one_header(out, "Subject", temp_hdr, chflags & CH_PREFIX ? prefix : 0,
+ mutt_window_wrap_cols(MuttIndexWindow, Wrap), chflags) == -1)
return -1;
- if (!(flags & CH_DECODE))
+ if (!(chflags & CH_DECODE))
FREE(&temp_hdr);
}
- if ((flags & CH_NONEWLINE) == 0)
+ if ((chflags & CH_NONEWLINE) == 0)
{
- if (flags & CH_PREFIX)
+ if (chflags & CH_PREFIX)
fputs(prefix, out);
fputc('\n', out); /* add header terminator */
}
* @param fpout Where to write output
* @param fpin Where to get input
* @param e Email being copied
- * @param flags Flags, e.g. #MUTT_CM_NOHEADER
+ * @param cmflags Flags, e.g. #MUTT_CM_NOHEADER
* @param chflags Flags to mutt_copy_header()
* @retval 0 Success
* @retval -1 Failure
*/
-int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e, int flags, int chflags)
+int mutt_copy_message_fp(FILE *fpout, FILE *fpin, struct Email *e, int cmflags, int chflags)
{
struct Body *body = e->content;
char prefix[SHORT_STRING];
LOFF_T new_offset = -1;
int rc = 0;
- if (flags & MUTT_CM_PREFIX)
+ if (cmflags & MUTT_CM_PREFIX)
{
if (TextFlowed)
mutt_str_strfcpy(prefix, ">", sizeof(prefix));
Context->mailbox, e);
}
- if ((flags & MUTT_CM_NOHEADER) == 0)
+ if ((cmflags & MUTT_CM_NOHEADER) == 0)
{
- if (flags & MUTT_CM_PREFIX)
+ if (cmflags & MUTT_CM_PREFIX)
chflags |= CH_PREFIX;
else if (e->attach_del && (chflags & CH_UPDATE_LEN))
}
/* Update original message if we are sync'ing a mailfolder */
- if (flags & MUTT_CM_UPDATE)
+ if (cmflags & MUTT_CM_UPDATE)
{
e->attach_del = false;
e->lines = new_lines;
new_offset = ftello(fpout);
}
- if (flags & MUTT_CM_DECODE)
+ if (cmflags & MUTT_CM_DECODE)
{
/* now make a text/plain version of the message */
struct State s = { 0 };
s.fp_in = fpin;
s.fp_out = fpout;
- if (flags & MUTT_CM_PREFIX)
+ if (cmflags & MUTT_CM_PREFIX)
s.prefix = prefix;
- if (flags & MUTT_CM_DISPLAY)
+ if (cmflags & MUTT_CM_DISPLAY)
s.flags |= MUTT_DISPLAY;
- if (flags & MUTT_CM_PRINTING)
+ if (cmflags & MUTT_CM_PRINTING)
s.flags |= MUTT_PRINTING;
- if (flags & MUTT_CM_WEED)
+ if (cmflags & MUTT_CM_WEED)
s.flags |= MUTT_WEED;
- if (flags & MUTT_CM_CHARCONV)
+ if (cmflags & MUTT_CM_CHARCONV)
s.flags |= MUTT_CHARCONV;
- if (flags & MUTT_CM_REPLYING)
+ if (cmflags & MUTT_CM_REPLYING)
s.flags |= MUTT_REPLYING;
- if ((WithCrypto != 0) && flags & MUTT_CM_VERIFY)
+ if ((WithCrypto != 0) && cmflags & MUTT_CM_VERIFY)
s.flags |= MUTT_VERIFY;
rc = mutt_body_handler(body, &s);
}
- else if ((WithCrypto != 0) && (flags & MUTT_CM_DECODE_CRYPT) && (e->security & SEC_ENCRYPT))
+ else if ((WithCrypto != 0) && (cmflags & MUTT_CM_DECODE_CRYPT) && (e->security & SEC_ENCRYPT))
{
struct Body *cur = NULL;
FILE *fp = NULL;
- if (((WithCrypto & APPLICATION_PGP) != 0) && (flags & MUTT_CM_DECODE_PGP) &&
+ if (((WithCrypto & APPLICATION_PGP) != 0) && (cmflags & MUTT_CM_DECODE_PGP) &&
(e->security & APPLICATION_PGP) && e->content->type == TYPE_MULTIPART)
{
if (crypt_pgp_decrypt_mime(fpin, &fp, e->content, &cur))
fputs("MIME-Version: 1.0\n", fpout);
}
- if (((WithCrypto & APPLICATION_SMIME) != 0) && (flags & MUTT_CM_DECODE_SMIME) &&
+ if (((WithCrypto & APPLICATION_SMIME) != 0) && (cmflags & MUTT_CM_DECODE_SMIME) &&
(e->security & APPLICATION_SMIME) && e->content->type == TYPE_APPLICATION)
{
if (crypt_smime_decrypt_mime(fpin, &fp, e->content, &cur))
{
if (fseeko(fpin, body->offset, SEEK_SET) < 0)
return -1;
- if (flags & MUTT_CM_PREFIX)
+ if (cmflags & MUTT_CM_PREFIX)
{
int c;
size_t bytes = body->length;
return -1;
}
- if ((flags & MUTT_CM_UPDATE) && (flags & MUTT_CM_NOHEADER) == 0 && new_offset != -1)
+ if ((cmflags & MUTT_CM_UPDATE) && (cmflags & MUTT_CM_NOHEADER) == 0 && new_offset != -1)
{
body->offset = new_offset;
mutt_body_free(&body->parts);
* @param fpout FILE pointer to write to
* @param src Source mailbox
* @param e Email
- * @param flags Flags, see: mutt_copy_message_fp()
+ * @param cmflags Flags, see: mutt_copy_message_fp()
* @param chflags Header flags, see: mutt_copy_header()
* @retval 0 Success
* @retval -1 Failure
* like partial decode, where it is worth displaying as much as possible
*/
int mutt_copy_message_ctx(FILE *fpout, struct Mailbox *src, struct Email *e,
- int flags, int chflags)
+ int cmflags, int chflags)
{
struct Message *msg = mx_msg_open(src, e->msgno);
if (!msg)
return -1;
if (!e->content)
return -1;
- int r = mutt_copy_message_fp(fpout, msg->fp, e, flags, chflags);
+ int r = mutt_copy_message_fp(fpout, msg->fp, e, cmflags, chflags);
if ((r == 0) && (ferror(fpout) || feof(fpout)))
{
mutt_debug(LL_DEBUG1, "failed to detect EOF!\n");
* @param fpin where to get input
* @param src source mailbox
* @param e Email being copied
- * @param flags mutt_open_copy_message() flags
+ * @param cmflags mutt_open_copy_message() flags
* @param chflags mutt_copy_header() flags
* @retval 0 Success
* @retval -1 Error
*/
static int append_message(struct Mailbox *dest, FILE *fpin, struct Mailbox *src,
- struct Email *e, int flags, int chflags)
+ struct Email *e, int cmflags, int chflags)
{
char buf[STRING];
struct Message *msg = NULL;
if (dest->magic == MUTT_MBOX || dest->magic == MUTT_MMDF)
chflags |= CH_FROM | CH_FORCE_FROM;
chflags |= (dest->magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
- r = mutt_copy_message_fp(msg->fp, fpin, e, flags, chflags);
+ r = mutt_copy_message_fp(msg->fp, fpin, e, cmflags, chflags);
if (mx_msg_commit(dest, msg) != 0)
r = -1;
* @param dest Destination Mailbox
* @param src Source Mailbox
* @param e Email
- * @param cmflags mutt_open_copy_message() flags
- * @param chflags mutt_copy_header() flags
+ * @param cmflags mutt_open_copy_message() cmflags
+ * @param chflags mutt_copy_header() cmflags
* @retval 0 Success
* @retval -1 Failure
*/
/**
* print_val - Add pieces to an email header, wrapping where necessary
- * @param fp File to write to
- * @param pfx Prefix for headers
- * @param value Text to be added
- * @param flags Flags, e.g. #CH_DISPLAY
- * @param col Column that this text starts at
+ * @param fp File to write to
+ * @param pfx Prefix for headers
+ * @param value Text to be added
+ * @param chflags Flags, e.g. #CH_DISPLAY
+ * @param col Column that this text starts at
* @retval 0 Success
* @retval -1 Failure
*/
-static int print_val(FILE *fp, const char *pfx, const char *value, int flags, size_t col)
+static int print_val(FILE *fp, const char *pfx, const char *value, int chflags, size_t col)
{
while (value && *value)
{
return -1;
/* corner-case: break words longer than 998 chars by force,
* mandated by RFC5322 */
- if (!(flags & CH_DISPLAY) && ++col >= 998)
+ if (!(chflags & CH_DISPLAY) && ++col >= 998)
{
if (fputs("\n ", fp) < 0)
return -1;
if (*(value + 1) && pfx && *pfx && fputs(pfx, fp) == EOF)
return -1;
/* for display, turn folding spaces into folding tabs */
- if ((flags & CH_DISPLAY) && (*(value + 1) == ' ' || *(value + 1) == '\t'))
+ if ((chflags & CH_DISPLAY) && (*(value + 1) == ' ' || *(value + 1) == '\t'))
{
value++;
while (*value && (*value == ' ' || *value == '\t'))
* @param value Header value
* @param pfx Prefix for header
* @param wraplen Column to wrap at
- * @param flags Flags, e.g. #CH_DISPLAY
+ * @param chflags Flags, e.g. #CH_DISPLAY
* @retval 0 Success
* @retval -1 Failure
*/
static int fold_one_header(FILE *fp, const char *tag, const char *value,
- const char *pfx, int wraplen, int flags)
+ const char *pfx, int wraplen, int chflags)
{
const char *p = value;
char buf[HUGE_STRING] = "";
int first = 1, col = 0, l = 0;
- const bool display = (flags & CH_DISPLAY);
+ const bool display = (chflags & CH_DISPLAY);
- mutt_debug(5, "pfx=[%s], tag=[%s], flags=%d value=[%s]\n", pfx, tag, flags, NONULL(value));
+ mutt_debug(5, "pfx=[%s], tag=[%s], flags=%d value=[%s]\n", pfx, tag, chflags, NONULL(value));
if (tag && *tag && fprintf(fp, "%s%s: ", NONULL(pfx), tag) < 0)
return -1;
}
if (fputc('\t', fp) == EOF)
return -1;
- if (print_val(fp, pfx, pc, flags, col) < 0)
+ if (print_val(fp, pfx, pc, chflags, col) < 0)
return -1;
col += 8;
}
- else if (print_val(fp, pfx, buf, flags, col) < 0)
+ else if (print_val(fp, pfx, buf, chflags, col) < 0)
return -1;
col += w;
* @param pfx Prefix for header
* @param start Start of header line
* @param end End of header line
- * @param flags Flags, e.g. #CH_DISPLAY
+ * @param chflags Flags, e.g. #CH_DISPLAY
* @retval 0 Success
* @retval -1 Failure
*/
static int write_one_header(FILE *fp, int pfxw, int max, int wraplen, const char *pfx,
- const char *start, const char *end, int flags)
+ const char *start, const char *end, int chflags)
{
char *tagbuf = NULL, *valbuf = NULL, *t = NULL;
int is_from = (end - start) > 5 && mutt_str_startswith(start, "from ", CASE_IGNORE);
/* only pass through folding machinery if necessary for sending,
never wrap From_ headers on sending */
- if (!(flags & CH_DISPLAY) && (pfxw + max <= wraplen || is_from))
+ if (!(chflags & CH_DISPLAY) && (pfxw + max <= wraplen || is_from))
{
valbuf = mutt_str_substr_dup(start, end);
mutt_debug(5, "buf[%s%s] short enough, max width = %d <= %d\n", NONULL(pfx),
FREE(&valbuf);
return 0;
}
- if (print_val(fp, pfx, valbuf, flags, mutt_str_strlen(pfx)) < 0)
+ if (print_val(fp, pfx, valbuf, chflags, mutt_str_strlen(pfx)) < 0)
{
FREE(&valbuf);
return -1;
}
mutt_debug(LL_DEBUG2, "buf[%s%s] too long, max width = %d > %d\n",
NONULL(pfx), NONULL(valbuf), max, wraplen);
- if (fold_one_header(fp, tagbuf, valbuf, pfx, wraplen, flags) < 0)
+ if (fold_one_header(fp, tagbuf, valbuf, pfx, wraplen, chflags) < 0)
{
FREE(&valbuf);
FREE(&tagbuf);
* @param value Header value
* @param pfx Prefix for header
* @param wraplen Column to wrap at
- * @param flags Flags, e.g. #CH_DISPLAY
+ * @param chflags Flags, e.g. #CH_DISPLAY
* @retval 0 Success
* @retval -1 Failure
*
* for each one
*/
int mutt_write_one_header(FILE *fp, const char *tag, const char *value,
- const char *pfx, int wraplen, int flags)
+ const char *pfx, int wraplen, int chflags)
{
char *p = (char *) value, *last = NULL, *line = NULL;
int max = 0, w, rc = -1;
int pfxw = mutt_strwidth(pfx);
char *v = mutt_str_strdup(value);
- bool display = (flags & CH_DISPLAY);
+ bool display = (chflags & CH_DISPLAY);
if (!display || Weed)
v = unfold_header(v);
}
else
{
- rc = fold_one_header(fp, tag, v, pfx, wraplen, flags);
+ rc = fold_one_header(fp, tag, v, pfx, wraplen, chflags);
goto out;
}
}
line = ++p;
if (*p != ' ' && *p != '\t')
{
- if (write_one_header(fp, pfxw, max, wraplen, pfx, last, p, flags) < 0)
+ if (write_one_header(fp, pfxw, max, wraplen, pfx, last, p, chflags) < 0)
goto out;
last = p;
max = 0;
}
if (last && *last)
- if (write_one_header(fp, pfxw, max, wraplen, pfx, last, p, flags) < 0)
+ if (write_one_header(fp, pfxw, max, wraplen, pfx, last, p, chflags) < 0)
goto out;
rc = 0;
if (f)
{
char date[SHORT_STRING];
- int ch_flags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
+ int chflags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM;
if (!BounceDelivered)
- ch_flags |= CH_WEED_DELIVERED;
+ chflags |= CH_WEED_DELIVERED;
fseeko(fp, e->offset, SEEK_SET);
fprintf(f, "Resent-From: %s", resent_from);
FREE(&msgid_str);
fputs("Resent-To: ", f);
mutt_write_address_list(to, f, 11, 0);
- mutt_copy_header(fp, e, f, ch_flags, NULL);
+ mutt_copy_header(fp, e, f, chflags, NULL);
fputc('\n', f);
mutt_file_copy_bytes(fp, f, e->content->length);
if (mutt_file_fclose(&f) != 0)