/* make up a Url we can turn into a string */
mutt_account_tourl(account, &url);
/* mutt_account_tourl() just sets up some pointers;
- * if this ever changes, we have a memleak here
- */
+ * if this ever changes, we have a memleak here */
url.path = NULL;
if (url_tostring(&url, host, sizeof(host), U_PATH) < 0)
{
menu->top = 0;
/* Reset menu position to 1.
* We do not risk overflow as the init_menu function changes
- * current if it is bigger than state->entrylen.
- */
+ * current if it is bigger than state->entrylen. */
if ((mutt_str_strcmp(state->entry[0].desc, "..") == 0) ||
(mutt_str_strcmp(state->entry[0].desc, "../") == 0))
{
/* Browser tracking feature.
* The goal is to highlight the good directory if LastDir is the parent dir
* of OldLastDir (this occurs mostly when one hit "../"). It should also work
- * properly when the user is in examine_mailboxes-mode.
- */
+ * properly when the user is in examine_mailboxes-mode. */
if (mutt_str_startswith(OldLastDir, LastDir, CASE_MATCH))
{
char target_dir[PATH_MAX] = "";
bool mailbox = (flags & MUTT_SEL_MAILBOX);
/* Keeps in memory the directory we were in when hitting '='
- * to go directly to $folder (#C_Folder)
- */
+ * to go directly to $folder (#C_Folder) */
char goto_swapper[PATH_MAX] = "";
mailbox = mailbox && folder;
{
/* Whether we use the tracking feature of the browser depends
* on which sort method we chose to use. This variable is defined
- * only to help readability of the code.
- */
+ * only to help readability of the code. */
bool browser_track = false;
switch (C_SortBrowser & SORT_MASK)
* when listing folders on startup with "neomutt -y").
*
* This tracker is only used when browser_track is true,
- * meaning only with sort methods SUBJECT/DESC for now.
- */
+ * meaning only with sort methods SUBJECT/DESC for now. */
if (CurrentFolder)
{
if (LastDir[0] == '\0')
{
/* If browsing in "local"-mode, than we chose to define LastDir to
- * MailDir
- */
+ * MailDir */
switch (mx_path_probe(CurrentFolder, NULL))
{
case MUTT_IMAP:
}
/* When browser tracking feature is disabled, shoot a 0
- * on first char of OldLastDir to make it useless.
- */
+ * on first char of OldLastDir to make it useless. */
if (!browser_track)
OldLastDir[0] = '\0';
}
mutt_free_color(tmp->fg, tmp->bg);
#endif
- /* we should really introduce a container
- * type for regular expressions.
- */
-
+ /* we should really introduce a container type for regular expressions. */
regfree(&tmp->regex);
mutt_pattern_free(&tmp->color_pattern);
FREE(&tmp->pattern);
}
/* Sigh. If we got this far, the color is of the form 'colorN'
- * Slang can handle this itself, so just return 'colorN'
- */
-
+ * Slang can handle this itself, so just return 'colorN' */
snprintf(dest, destlen, "color%d", val);
return dest;
}
/* delay use_default_colors() until needed, since it initializes things */
&& ((fg == COLOR_DEFAULT) || (bg == COLOR_DEFAULT) || (object == MT_COLOR_TREE)) &&
(use_default_colors() != OK))
- /* the case of the tree object is special, because a non-default
- * fg color of the tree element may be combined dynamically with
- * the default bg color of an index line, not necessarily defined in
- * a rc file.
- */
+ /* the case of the tree object is special, because a non-default fg color of
+ * the tree element may be combined dynamically with the default bg color of
+ * an index line, not necessarily defined in a rc file. */
{
mutt_buffer_strcpy(err, _("default colors not supported"));
return MUTT_CMD_ERROR;
/* 'color status fg bg' can have up to 2 arguments:
* 0 arguments: sets the default status color (handled below by else part)
* 1 argument : colorize pattern on match
- * 2 arguments: colorize nth submatch of pattern
- */
+ * 2 arguments: colorize nth submatch of pattern */
mutt_extract_token(buf, s, 0);
if (MoreArgs(s))
/* Note: We don't convert IDNA to local representation this time.
* That is intentional, so the user has an opportunity to copy &
* paste the on-the-wire form of the address to other, IDN-unable
- * software.
- */
-
+ * software. */
buf[0] = '\0';
mutt_addr_write(buf, sizeof(buf), addr, false);
mutt_message("%s: %s", pfx, buf);
buf[pathlen - 1] = '\0';
/* This is an undocumented feature of ELM pointed out to me by Felix von
- * Leitner <leitner@prz.fu-berlin.de>
- */
+ * Leitner <leitner@prz.fu-berlin.de> */
if (mutt_str_strcmp(buf, ".") == 0)
mutt_str_strfcpy(buf, LastSaveFolder, sizeof(buf));
else
}
/* special case to handle when there is no filepart yet. find the first
- * file/directory which is not "." or ".."
- */
+ * file/directory which is not "." or ".." */
len = mutt_str_strlen(filepart);
if (len == 0)
{
static void compose_attach_swap(struct Body *msg, struct AttachPtr **idx, short first)
{
/* Reorder Body pointers.
- * Must traverse msg from top since Body has no previous ptr.
- */
+ * Must traverse msg from top since Body has no previous ptr. */
for (struct Body *part = msg; part; part = part->next)
{
if (part->next == idx[first]->content)
case OP_COMPOSE_SEND_MESSAGE:
/* Note: We don't invoke send2-hook here, since we want to leave
- * users an opportunity to change settings from the ":" prompt.
- */
+ * users an opportunity to change settings from the ":" prompt. */
if (check_attachments(actx) != 0)
{
menu->redraw = REDRAW_FULL;
if (ret == 0)
{
/* As opposed to RENAME_FILE, we don't check buf[0] because it's
- * valid to set an empty string here, to erase what was set
- */
+ * valid to set an empty string here, to erase what was set */
mutt_str_replace(&CURATTACH->content->d_filename, buf);
menu->redraw = REDRAW_CURRENT;
}
/* Allow 0.1 seconds to get the FQDN (fully-qualified domain name).
* If it takes longer, the system is mis-configured and the network is not
- * working properly, so...
- */
+ * working properly, so... */
struct timespec timeout = { 0, 100000000 };
struct gaicb *reqs[1];
reqs[0] = mutt_mem_calloc(1, sizeof(*reqs[0]));
#endif
/* LibreSSL defines OPENSSL_VERSION_NUMBER but sets it to 0x20000000L.
- * So technically we don't need the defined(OPENSSL_VERSION_NUMBER) check.
- */
+ * So technically we don't need the defined(OPENSSL_VERSION_NUMBER) check. */
#if (defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L) || \
(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
#define X509_get0_notBefore X509_get_notBefore
/* This is ugly, but as RAND_status came in on OpenSSL version 0.9.5
* and the code has to support older versions too, this is seemed to
- * be cleaner way compared to having even uglier #ifdefs all around.
- */
+ * be cleaner way compared to having even uglier #ifdefs all around. */
#ifdef HAVE_RAND_STATUS
#define HAVE_ENTROPY() (RAND_status() == 1)
#else
unsigned int mdlen;
/* Avoid CPU-intensive digest calculation if the certificates are
- * not even remotely equal.
- */
+ * not even remotely equal. */
if ((X509_subject_name_cmp(cert, peercert) != 0) ||
(X509_issuer_name_cmp(cert, peercert) != 0))
return false;
goto out;
}
/* cast is safe since bufsize is incremented above, so bufsize-1 is always
- * zero or greater.
- */
+ * zero or greater. */
if (mutt_str_strlen(buf) == (size_t) bufsize - 1)
{
match_found = hostname_match(hostname_ascii, buf);
/* Inside ssl_verify_callback(), this function is guarded by a call to
* check_certificate_by_digest(). This means if check_certificate_expiration() is
* true, then check_certificate_file() must be false. Therefore we don't need
- * to also scan the certificate file here.
- */
+ * to also scan the certificate file here. */
allow_always = allow_always && C_CertificateFile &&
check_certificate_expiration(cert, true);
* not verify and the user manually chose to skip it via the
* $ssl_verify_partial_chains option.
* In this case, all following certificates need to be treated as non-verified
- * until one is actually verified.
- */
+ * until one is actually verified. */
skip_mode = (SSL_get_ex_data(ssl, SkipModeExDataIndex));
cert = X509_STORE_CTX_get_current_cert(ctx);
#ifdef HAVE_SSL_PARTIAL_CHAIN
/* Sometimes, when a certificate is (s)kipped, OpenSSL will pass it
* a second time with preverify_ok = 1. Don't show it or the user
- * will think their "s" key is broken.
- */
+ * will think their "s" key is broken. */
if (C_SslVerifyPartialChains)
{
static int last_pos = 0;
if (i == 0)
{
/* This is the peer's end-entity X.509 certificate. Stash the result
- * to check later in this function.
- */
+ * to check later in this function. */
rcpeer = rc;
}
certstat = tls_verify_peers(state);
/* If the cert chain now verifies, and the peer's cert was otherwise
- * valid (rcpeer==0), we are done.
- */
+ * valid (rcpeer==0), we are done. */
if (!certstat && !rcpeer)
return 1;
}
*
* It is not required for the initiator of the close to wait for the
* responding close_notify alert before closing the read side of the
- * connection.
- */
+ * connection. */
gnutls_bye(data->state, GNUTLS_SHUT_WR);
gnutls_certificate_free_credentials(data->xcred);
/* The path mx_mbox_check() -> imap_check_mailbox() ->
* imap_expunge_mailbox() -> ctx_update_tables()
* can occur before a call to mx_mbox_sync(), resulting in
- * last_tag being stale if it's not reset here.
- */
+ * last_tag being stale if it's not reset here. */
if (ctx->last_tag == m->emails[i])
ctx->last_tag = NULL;
mutt_email_free(&m->emails[i]);
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
- */
+ * we can do a more efficient line to line copying */
while (ftello(fp_in) < off_end)
{
nl = strchr(buf, '\n');
/* We are going to read and collect the headers in an array
* so we are able to do re-ordering.
- * First count the number of entries in the array
- */
+ * First count the number of entries in the array */
if (chflags & CH_REORDER)
{
struct ListNode *np = NULL;
if (headers[x])
{
/* We couldn't do the prefixing when reading because RFC2047
- * decoding may have concatenated lines.
- */
-
+ * decoding may have concatenated lines. */
if (chflags & (CH_DECODE | CH_PREFIX))
{
if (mutt_write_one_header(
/* In order to prevent the default answer to the question to wrapped
* around the screen in the even the question is wider than the screen,
* ensure there is enough room for the answer and truncate the question
- * to fit.
- */
+ * to fit. */
safe_asprintf(&answer_string, " ([%s]/%s): ", def == MUTT_YES ? yes : no,
def == MUTT_YES ? no : yes);
answer_string_wid = mutt_strwidth(answer_string);
* truncate the last newline in the temp file, which is logically part of
* the message separator, and not the body of the message. If we fail to
* remove it, the message will grow by one line each time the user edits
- * the message.
- */
+ * the message. */
if ((sb.st_size != 0) && (truncate(fname, sb.st_size - 1) == -1))
{
mutt_error(_("could not truncate temporary mail folder: %s"), strerror(errno));
* atom = 1*<any CHAR except specials, SPACE and CTLs>
* CHAR = ( 0.-127. )
* specials = "(" / ")" / "<" / ">" / "@"
- / "," / ";" / ":" / "\" / <">
- / "." / "[" / "]"
+ * / "," / ";" / ":" / "\" / <">
+ * / "." / "[" / "]"
* SPACE = ( 32. )
* CTLS = ( 0.-31., 127.)
* quoted-string = <"> *(qtext/quoted-pair) <">
/* do a quick check to make sure that this isn't really the day of the week.
* this could happen when receiving mail from a local user whose login name
- * is the same as a three-letter abbreviation of the day of the week.
- */
+ * is the same as a three-letter abbreviation of the day of the week. */
if (mutt_date_is_day_name(s))
{
s = mutt_str_next_word(s);
#ifdef HAVE_LIBIDN
/* If the original domain was UTF-8, idna encoding here could
* produce a non-matching domain! Thus we only want to do the
- * idna_to_ascii_8z() if the original domain was IDNA encoded.
- */
+ * idna_to_ascii_8z() if the original domain was IDNA encoded. */
if (is_idn_encoded && C_IdnDecode)
{
if (idna_to_ascii_8z(reversed_domain, &tmp, IDNA_ALLOW_UNASSIGNED) != IDNA_SUCCESS)
i--;
/* the check for the missing parameter token is here so that we can skip
- * over any quoted value that may be present.
- */
+ * over any quoted value that may be present. */
if (i == 0)
{
mutt_debug(LL_DEBUG1, "missing attribute: %s\n", s);
if (!ct->subtype)
{
/* Some older non-MIME mailers (i.e., mailtool, elm) have a content-type
- * field, so we can attempt to convert the type to Body here.
- */
+ * field, so we can attempt to convert the type to Body here. */
if (ct->type == TYPE_TEXT)
ct->subtype = mutt_str_strdup("plain");
else if (ct->type == TYPE_AUDIO)
if (e)
{
/* HACK - neomutt has, for a very short time, produced negative
- * Lines header values. Ignore them.
- */
+ * Lines header values. Ignore them. */
if ((mutt_str_atoi(p, &e->lines) < 0) || (e->lines < 0))
e->lines = 0;
}
break;
}
#endif
- /* Consistency checking - catch
- * bad attachment end boundaries
- */
-
+ /* Consistency checking - catch bad attachment end boundaries */
if (new->offset > end_off)
{
mutt_body_free(&new);
/* Keep some state in case the next decoded word is using the same charset
* and it happens to be split in the middle of a multibyte character.
- * See https://github.com/neomutt/neomutt/issues/1015
- */
+ * See https://github.com/neomutt/neomutt/issues/1015 */
struct Buffer prev = { 0 }; /* Previously decoded word */
char *prev_charset = NULL; /* Previously used charset */
size_t prev_charsetlen = 0; /* Length of the previously used charset */
/* Using RFC2047 encoding in MIME parameters is explicitly
* forbidden by that document. Nevertheless, it's being
* generated by some software, including certain Lotus Notes to
- * Internet Gateways. So we actually decode it.
- */
+ * Internet Gateways. So we actually decode it. */
if (C_Rfc2047Parameters && np->value && strstr(np->value, "=?"))
rfc2047_decode(&np->value);
size_t slen, dlen = 0;
/* A shortcut to detect pure 7bit data.
- * This should prevent the worst when character set handling is flawed.
- */
-
+ * This should prevent the worst when character set handling is flawed. */
for (s = *pd; *s; s++)
if (*s & 0x80)
break;
it = at + 1;
}
- /* IPv6 literal address. It may contain colons, so set p to start
- * the port scan after it.
- */
+ /* IPv6 literal address. It may contain colons, so set p to start the port
+ * scan after it. */
if ((*it == '[') && (p = strchr(it, ']')))
{
it++;
* been changed, and is marked accordingly. However, we do
* _not_ mark the message itself changed, because trashing
* is checked in specific code in the maildir folder
- * driver.
- */
+ * driver. */
if ((m->magic == MUTT_MAILDIR) && upd_mbox && e->trash)
m->changed = true;
}
/* if the message status has changed, we need to invalidate the cached
* search results so that any future search will match the current status
- * of this message and not what it was at the time it was last searched.
- */
+ * of this message and not what it was at the time it was last searched. */
if (e->searched && ((changed != e->changed) || (deleted != m->msg_deleted) ||
(tagged != m->msg_tagged) || (flagged != m->msg_flagged)))
{
* out to be longer than this. Just process the line in chunks. This
* really shouldn't happen according the MIME spec, since Q-P encoded
* lines are at most 76 characters, but we should be liberal about what
- * we accept.
- */
+ * we accept. */
if (!fgets(line, MIN((ssize_t) sizeof(line), len + 1), s->fp_in))
break;
len -= linelen;
/* inspect the last character we read so we can tell if we got the
- * entire line.
- */
+ * entire line. */
const int last = linelen ? line[linelen - 1] : 0;
/* chop trailing whitespace if we got the full line */
}
#endif
/* decoding the attachment changes the size and offset, so save a copy
- * of the "real" values now, and restore them after processing
- */
+ * of the "real" values now, and restore them after processing */
tmplength = b->length;
tmpoffset = b->offset;
/* if we are decoding binary bodies, we don't want to prefix each
- * line with the prefix or else the data will get corrupted.
- */
+ * line with the prefix or else the data will get corrupted. */
save_prefix = s->prefix;
s->prefix = NULL;
if (mutt_str_strcasecmp("plain", b->subtype) == 0)
{
/* avoid copying this part twice since removing the transfer-encoding is
- * the only operation needed.
- */
+ * the only operation needed. */
if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
handler = crypt_pgp_application_handler;
else if (C_ReflowText &&
/* At this stage remain only message-hooks, reply-hooks, send-hooks,
* send2-hooks, save-hooks, and fcc-hooks: All those allowing full
- * patterns. If given a simple regex, we expand $default_hook.
- */
+ * patterns. If given a simple regex, we expand $default_hook. */
mutt_str_strfcpy(tmp, pattern.data, sizeof(tmp));
mutt_check_simple(tmp, sizeof(tmp), C_DefaultHook);
FREE(&pattern.data);
* The data encoded in the first ready response contains a presumptively
* arbitrary string of random digits, a timestamp, and the fully-qualified
* primary host name of the server. The syntax of the unencoded form must
- * correspond to that of an RFC822 'msg-id' [RFC822] as described in [POP3].
- */
+ * correspond to that of an RFC822 'msg-id' [RFC822] as described in [POP3]. */
do
rc = imap_cmd_step(adata);
while (rc == IMAP_CMD_CONTINUE);
* Note: The user name shouldn't be quoted. Since the digest can't contain
* spaces, there is no ambiguity. Some servers get this wrong, we'll work
* around them when the bug report comes in. Until then, we'll remain
- * blissfully RFC-compliant.
- */
+ * blissfully RFC-compliant. */
hmac_md5(adata->conn->account.pass, obuf, hmac_response);
/* dubious optimisation I saw elsewhere: make the whole string in one call */
int off = snprintf(obuf, sizeof(obuf), "%s ", adata->conn->account.user);
snprintf(ibuf, ilen, "AUTHENTICATE OAUTHBEARER %s", oauthbearer);
/* This doesn't really contain a password, but the token is good for
- * an hour, so suppress it anyways.
- */
+ * an hour, so suppress it anyways. */
rc = imap_exec(adata, ibuf, IMAP_CMD_PASS);
FREE(&oauthbearer);
if (rc == IMAP_EXEC_SUCCESS)
{
/* The error response was in SASL continuation, so continue the SASL
- * to cause a failure and exit SASL input. See RFC 7628 3.2.3
- */
+ * to cause a failure and exit SASL input. See RFC 7628 3.2.3 */
mutt_socket_send(adata->conn, "\001");
rc = imap_exec(adata, ibuf, 0);
}
*
* So when these are equal, it means we are actually closing the
* mailbox and should clean up adata. Otherwise, we don't want to
- * touch adata - it's still being used.
- */
+ * touch adata - it's still being used. */
if (m == adata->mailbox)
{
if ((adata->status != IMAP_FATAL) && (adata->state >= IMAP_SELECTED))
/* If there are local_changes, we only want to note if the server
* flags have changed, so we can set a reopen flag in
* cmd_parse_fetch(). We don't want to count a local modification
- * to the header flag as a "change".
- */
+ * to the header flag as a "change". */
if ((old_hd_flag == new_hd_flag) && local_changes)
return;
/* this DO loop does two things:
* 1. handles untagged messages, so we can try again on the same msg
- * 2. fetches the tagged response at the end of the last message.
- */
+ * 2. fetches the tagged response at the end of the last message. */
do
{
rc = imap_cmd_step(adata);
*
* Note: The RFC says we shouldn't get any EXPUNGE responses in the
* middle of a FETCH. But just to be cautious, use the current state
- * of max_msn, not fetch_msn_end to set the next start range.
- */
+ * of max_msn, not fetch_msn_end to set the next start range. */
if (mdata->reopen & IMAP_NEWMAIL_PENDING)
{
/* update to the last value we actually pulled down */
has_condstore = true;
/* If IMAP_CAP_QRESYNC and ImapQResync then Mutt sends ENABLE QRESYNC.
- * If we receive an ENABLED response back, then adata->qresync is set.
- */
+ * If we receive an ENABLED response back, then adata->qresync is set. */
if (adata->qresync)
has_qresync = true;
}
/* We currently only sync CONDSTORE and QRESYNC on the initial download.
* To do it more often, we'll need to deal with flag updates combined with
* unsync'ed local flag changes. We'll also need to properly sync flags to
- * the header cache on close. I'm not sure it's worth the added complexity.
- */
+ * the header cache on close. I'm not sure it's worth the added complexity. */
if (initial_download)
{
if (has_condstore || has_qresync)
m->readonly = false;
/* This is redundant with the following two checks. Removing:
- * mutt_set_flag (m, e, MUTT_NEW, !(edata->read || edata->old));
- */
+ * mutt_set_flag (m, e, MUTT_NEW, !(edata->read || edata->old)); */
set_changed_flag(m, e, local_changes, server_changes, MUTT_OLD, old_edata.old,
edata->old, e->old);
set_changed_flag(m, e, local_changes, server_changes, MUTT_READ,
parsemsg:
/* Update the header information. Previously, we only downloaded a
- * portion of the headers, those required for the main display.
- */
+ * portion of the headers, those required for the main display. */
rewind(msg->fp);
/* It may be that the Status header indicates a message is read, but the
* IMAP server doesn't know the message has been \Seen. So we capture
bool base64 = false;
/* In the worst case we convert 2 chars to 7 chars. For example:
- * "\x10&\x10&..." -> "&ABA-&-&ABA-&-...".
- */
+ * "\x10&\x10&..." -> "&ABA-&-&ABA-&-...". */
char *buf = mutt_mem_malloc((u8len / 2) * 7 + 6);
char *p = buf;
* the "/" after the 'a's.
*
* If buf == '/', then n-- => n == 0, so the loop ends
- * immediately
- */
+ * immediately */
for (n--; n >= 0 && buf[n] != delim; n--)
;
- /* We stopped before the beginning. There is a trailing
- * slash.
- */
+ /* We stopped before the beginning. There is a trailing slash. */
if (n > 0)
{
/* Strip the trailing delimiter. */
/* If C_Sort is reverse and not threaded, the latest message is first.
* If C_Sort is threaded, the latest message is first if exactly one
- * of C_Sort and C_SortAux are reverse.
- */
+ * of C_Sort and C_SortAux are reverse. */
if (((C_Sort & SORT_REVERSE) && ((C_Sort & SORT_MASK) != SORT_THREADS)) ||
(((C_Sort & SORT_MASK) == SORT_THREADS) && ((C_Sort ^ C_SortAux) & SORT_REVERSE)))
{
while (true)
{
/* Clear the tag prefix unless we just started it. Don't clear
- * the prefix on a timeout (op==-2), but do clear on an abort (op==-1)
- */
+ * the prefix on a timeout (op==-2), but do clear on an abort (op==-1) */
if (tag && (op != OP_TAG_PREFIX) && (op != OP_TAG_PREFIX_COND) && (op != -2))
tag = false;
/* check if we need to resort the index because just about
* any 'op' below could do mutt_enter_command(), either here or
- * from any new menu launched, and change $sort/$sort_aux
- */
+ * from any new menu launched, and change $sort/$sort_aux */
if (OptNeedResort && Context && (Context->mailbox->msg_count != 0) &&
(menu->current >= 0))
resort_index(menu);
int check;
/* check for new mail in the mailbox. If nonzero, then something has
* changed about the file (either we got new mail or the file was
- * modified underneath us.)
- */
+ * modified underneath us.) */
index_hint = ((Context->mailbox->vcount != 0) && (menu->current >= 0) &&
(menu->current < Context->mailbox->vcount)) ?
SigWinch = 0;
menu->top = 0; /* so we scroll the right amount */
/* force a real complete redraw. clrtobot() doesn't seem to be able
- * to handle every case without this.
- */
+ * to handle every case without this. */
clearok(stdscr, true);
continue;
}
if (!prereq(Context, menu, CHECK_IN_MAILBOX | CHECK_MSGCOUNT | CHECK_VISIBLE))
break;
/* toggle the weeding of headers so that a user can press the key
- * again while reading the message.
- */
+ * again while reading the message. */
if (op == OP_DISPLAY_HEADERS)
bool_str_toggle(Config, "weed", NULL);
#ifdef USE_IMAP
/* in an IMAP folder index with imap_peek=no, piping could change
- * new or old messages status to read. Redraw what's needed.
- */
+ * new or old messages status to read. Redraw what's needed. */
if ((Context->mailbox->magic == MUTT_IMAP) && !C_ImapPeek)
{
menu->redraw |= (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
#ifdef USE_IMAP
/* in an IMAP folder index with imap_peek=no, printing could change
- * new or old messages status to read. Redraw what's needed.
- */
+ * new or old messages status to read. Redraw what's needed. */
if ((Context->mailbox->magic == MUTT_IMAP) && !C_ImapPeek)
{
menu->redraw |= (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
* understand more than the "subject" and "body" headers. Clients that
* resolve mailto URLs into mail messages should be able to correctly
* create RFC822-compliant mail messages using the "subject" and "body"
- * headers.
- */
+ * headers. */
add_to_stailq(&MailToAllow, "body");
add_to_stailq(&MailToAllow, "subject");
/* Cc, In-Reply-To, and References help with not breaking threading on
complete_all_nm_tags(pt);
/* All matches are stored. Longest non-ambiguous string is ""
- * i.e. don't change 'buf'. Fake successful return this time.
- */
+ * i.e. don't change 'buf'. Fake successful return this time. */
if (UserTyped[0] == 0)
return true;
}
complete_all_nm_tags(pt);
/* All matches are stored. Longest non-ambiguous string is ""
- * i.e. don't change 'buf'. Fake successful return this time.
- */
+ * i.e. don't change 'buf'. Fake successful return this time. */
if (UserTyped[0] == 0)
return true;
}
mutt_getch_timeout(-1);
/* If a timeout was not received, or the window was resized, exit the
* loop now. Otherwise, continue to loop until reaching a total of
- * $timeout seconds.
- */
+ * $timeout seconds. */
#ifdef USE_INOTIFY
if ((tmp.ch != -2) || SigWinch || MonitorFilesChanged)
#else
return true;
}
/* there were no mailboxes needing to be notified, so clean up since
- * MailboxNotify has somehow gotten out of sync
- */
+ * MailboxNotify has somehow gotten out of sync */
MailboxNotify = 0;
return false;
}
mutt_buffer_printf(path, "%s/%s", m->path, dir_name);
/* when $mail_check_recent is set, if the new/ directory hasn't been modified since
- * the user last exited the m, then we know there is no recent mail.
- */
+ * the user last exited the m, then we know there is no recent mail. */
if (check_new && C_MailCheckRecent)
{
if ((stat(mutt_b2s(path), &sb) == 0) &&
static int maildir_read_dir(struct Mailbox *m)
{
/* maildir looks sort of like MH, except that there are two subdirectories
- * of the main folder path from which to read messages
- */
+ * of the main folder path from which to read messages */
if ((mh_read_dir(m, "new") == -1) || (mh_read_dir(m, "cur") == -1))
return -1;
* subdirectory have the :unique string appended, regardless of whether
* or not there are any flags. If .old is set, we know that this message
* will end up in the cur directory, so we include it in the following
- * test even though there is no associated flag.
- */
+ * test even though there is no associated flag. */
if (e && (e->flagged || e->replied || e->read || e->deleted || e->old || e->maildir_flags))
{
}
/* do a fast scan of just the filenames in
- * the subdirectories that have changed.
- */
+ * the subdirectories that have changed. */
md = NULL;
last = &md;
if (changed & 1)
/* we create a hash table keyed off the canonical (sans flags) filename
* of each message we scanned. This is used in the loop over the
- * existing messages below to do some correlation.
- */
+ * existing messages below to do some correlation. */
fnames = mutt_hash_new(count, 0);
for (p = md; p; p = p->next)
m->emails[i]->active = true;
/* check to see if the message has moved to a different
- * subdirectory. If so, update the associated filename.
- */
+ * subdirectory. If so, update the associated filename. */
if (mutt_str_strcmp(m->emails[i]->path, p->email->path) != 0)
mutt_str_replace(&m->emails[i]->path, p->email->path);
/* if the user hasn't modified the flags on this message, update
- * the flags we just detected.
- */
+ * the flags we just detected. */
if (!m->emails[i]->changed)
if (maildir_update_flags(m, m->emails[i], p->email))
flags_changed = true;
}
/* This message was not in the list of messages we just scanned.
* Check to see if we have enough information to know if the
- * message has disappeared out from underneath us.
- */
+ * message has disappeared out from underneath us. */
else if (((changed & 1) && (strncmp(m->emails[i]->path, "new/", 4) == 0)) ||
((changed & 2) && (strncmp(m->emails[i]->path, "cur/", 4) == 0)))
{
/* This message disappeared, so we need to simulate a "reopen"
* event. We know it disappeared because we just scanned the
- * subdirectory it used to reside in.
- */
+ * subdirectory it used to reside in. */
occult = true;
}
else
{
/* This message resides in a subdirectory which was not
* modified, so we assume that it is still present and
- * unchanged.
- */
+ * unchanged. */
m->emails[i]->active = true;
}
}
/* Adjust the mtime on the file to match the time at which this
* message was received. Currently this is only set when copying
* messages between mailboxes, so we test to ensure that it is
- * actually set.
- */
+ * actually set. */
if (msg->received)
{
struct utimbuf ut;
*
* Anyway, if this fails, the message is in the folder, so
* all what happens is that a concurrently running neomutt will
- * lose flag modifications.
- */
+ * lose flag modifications. */
if ((m->magic == MUTT_MH) && (rc == 0))
{
if (magic == MUTT_MAILDIR)
{
/* maildir stores its flags in the filename, so ignore the
- * flags in the header of the message
- */
+ * flags in the header of the message */
e->old = is_old;
maildir_parse_flags(e, fname);
return -1;
/* save the global state here so we can reset it at the
- * end of list block if required.
- */
+ * end of list block if required. */
bool context_changed = m->changed;
/* user didn't modify this message. alter the flags to match the
/* mutt_set_flag() will set this, but we don't need to
* sync the changes we made because we just updated the
* context to match the current on-disk state of the
- * message.
- */
+ * message. */
bool header_changed = o->changed;
o->changed = false;
/* if the mailbox was not modified before we made these
* changes, unset the changed flag since nothing needs to
- * be synchronized.
- */
+ * be synchronized. */
if (!context_changed)
m->changed = false;
do
{
/* we do "cur" on the first iteration since it's more likely that we'll
- * find old messages without having to scan both subdirs
- */
+ * find old messages without having to scan both subdirs */
snprintf(realpath, sizeof(realpath), "%s/%s", path, iter == 0 ? "cur" : "new");
dp = opendir(realpath);
if (!dp)
/* We're getopt'ing POSIXLY, so we'll be here every time getopt()
* encounters a non-option. That could be a file to attach
* (all non-options between -a and --) or it could be an address
- * (which gets collapsed to the front of argv).
- */
+ * (which gets collapsed to the front of argv). */
for (; optind < argc; optind++)
{
if ((argv[optind][0] == '-') && (argv[optind][1] != '\0'))
/* Copy input to a tempfile, and re-point fp_in to the tempfile.
* Note: stdin is always copied to a tempfile, ensuring draft_file
- * can stat and get the correct st_size below.
- */
+ * can stat and get the correct st_size below. */
if (!edit_infile)
{
char buf[1024];
}
}
/* If editing the infile, keep it around afterwards so
- * it doesn't get unlinked, and we can rebuild the draft_file
- */
+ * it doesn't get unlinked, and we can rebuild the draft_file */
else
sendflags |= SEND_NO_FREE_HEADER;
/* Parse the draft_file into the full Header/Body structure.
* Set SEND_DRAFT_FILE so ci_send_message doesn't overwrite
- * our msg->content.
- */
+ * our msg->content. */
if (draft_file)
{
struct Envelope *opts_env = msg->env;
sendflags |= SEND_DRAFT_FILE;
/* Set up a "context" header with just enough information so that
- * mutt_prepare_template() can parse the message in fp_in.
- */
+ * mutt_prepare_template() can parse the message in fp_in. */
struct Email *context_hdr = mutt_email_new();
context_hdr->offset = 0;
context_hdr->content = mutt_body_new();
mutt_email_free(&context_hdr);
}
/* Editing the include_file: pass it directly in.
- * Note that SEND_NO_FREE_HEADER is set above so it isn't unlinked.
- */
+ * Note that SEND_NO_FREE_HEADER is set above so it isn't unlinked. */
else if (edit_infile)
bodyfile = expanded_infile;
/* For bodytext and unedited include_file: use the tempfile.
}
/* If the message was sent or postponed, these will already
- * have been done.
- */
+ * have been done. */
if (rv < 0)
{
if (msg->content->next)
/* 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
- * save time by not having to search for the next message marker).
- */
+ * save time by not having to search for the next message marker). */
if (e_cur->content->length > 0)
{
LOFF_T tmploc;
loc = ftello(adata->fp);
/* The test below avoids a potential integer overflow if the
- * content-length is huge (thus necessarily invalid).
- */
+ * content-length is huge (thus necessarily invalid). */
tmploc = (e_cur->content->length < m->size) ?
(loc + e_cur->content->length + 1) :
-1;
if ((tmploc > 0) && (tmploc < m->size))
{
/* check to see if the content-length looks valid. we expect to
- * to see a valid message separator at this point in the stream
- */
+ * to see a valid message separator at this point in the stream */
if ((fseeko(adata->fp, tmploc, SEEK_SET) != 0) ||
!fgets(buf, sizeof(buf), adata->fp) ||
!mutt_str_startswith(buf, "From ", CASE_MATCH))
else if (tmploc != m->size)
{
/* content-length would put us past the end of the file, so it
- * must be wrong
- */
+ * must be wrong */
e_cur->content->length = -1;
}
if (e_cur->content->length != -1)
{
/* good content-length. check to see if we know how many lines
- * are in this message.
- */
+ * are in this message. */
if (e_cur->lines == 0)
{
int cl = e_cur->content->length;
/* Only set the content-length of the previous message if we have read more
* than one message during _this_ invocation. If this routine is called
* when new mail is received, we need to make sure not to clobber what
- * previously was the last message since the headers may be sorted.
- */
+ * previously was the last message since the headers may be sorted. */
if (count > 0)
{
struct Email *e = m->emails[m->msg_count - 1];
/* some messages have been deleted, and new messages have been
* appended at the end; the heuristic is that old messages have then
* "advanced" towards the beginning of the folder, so we begin the
- * search at index "i"
- */
+ * search at index "i" */
int j;
for (j = i; j < old_msg_count; j++)
{
{
/* Only update the flags if the old header was changed;
* otherwise, the header may have been modified externally,
- * and we don't want to lose _those_ changes
- */
+ * and we don't want to lose _those_ changes */
mutt_set_flag(m, m->emails[i], MUTT_FLAG, old_hdrs[j]->flagged);
mutt_set_flag(m, m->emails[i], MUTT_REPLIED, old_hdrs[j]->replied);
mutt_set_flag(m, m->emails[i], MUTT_OLD, old_hdrs[j]->old);
utimebuf.modtime = st->st_mtime;
/* When $mbox_check_recent is set, existing new mail is ignored, so do not
- * reset the atime to mtime-1 to signal new mail.
- */
+ * reset the atime to mtime-1 to signal new mail. */
if (!C_MailCheckRecent && (utimebuf.actime >= utimebuf.modtime) && mbox_has_new(m))
{
utimebuf.actime = utimebuf.modtime - 1;
mutt_sig_unblock();
/* we couldn't lock the mailbox, but nothing serious happened:
* probably the new mail arrived: no reason to wait till we can
- * parse it: we'll get it on the next pass
- */
+ * parse it: we'll get it on the next pass */
return MUTT_LOCKED;
}
unlock = 1;
/* Check to make sure that the only change to the mailbox is that
* message(s) were appended to this file. My heuristic is that we should
* see the message separator at *exactly* what used to be the end of the
- * folder.
- */
+ * folder. */
char buf[1024];
if (fseeko(adata->fp, m->size, SEEK_SET) != 0)
mutt_debug(LL_DEBUG1, "#1 fseek() failed\n");
}
/* need to open the file for writing in such a way that it does not truncate
- * the file, so use read-write mode.
- */
+ * the file, so use read-write mode. */
adata->fp = freopen(m->path, "r+", adata->fp);
if (!adata->fp)
{
}
/* find the first deleted/changed message. we save a lot of time by only
- * rewriting the mailbox from the point where it has actually changed.
- */
+ * rewriting the mailbox from the point where it has actually changed. */
for (i = 0; (i < m->msg_count) && !m->emails[i]->deleted &&
!m->emails[i]->changed && !m->emails[i]->attach_del;
i++)
{
/* this means ctx->changed or m->msg_deleted was set, but no
* messages were found to be changed or deleted. This should
- * never happen, is we presume it is a bug in neomutt.
- */
+ * never happen, is we presume it is a bug in neomutt. */
mutt_error(
_("sync: mbox modified, but no modified messages (report this bug)"));
mutt_debug(LL_DEBUG1, "no modified messages.\n");
offset = m->emails[i]->offset;
/* the offset stored in the header does not include the MMDF_SEP, so make
- * sure we seek to the correct location
- */
+ * sure we seek to the correct location */
if (m->magic == MUTT_MMDF)
offset -= (sizeof(MMDF_SEP) - 1);
if (!m->quiet)
mutt_progress_update(&progress, i, (int) (ftello(adata->fp) / (m->size / 100 + 1)));
/* back up some information which is needed to restore offsets when
- * something fails.
- */
+ * something fails. */
old_offset[i - first].valid = true;
old_offset[i - first].hdr = m->emails[i]->offset;
/* save the new offset for this message. we add 'offset' because the
* temporary file only contains saved message which are located after
- * 'offset' in the real mailbox
- */
+ * 'offset' in the real mailbox */
new_offset[i - first].hdr = ftello(fp) + offset;
if (mutt_copy_message_ctx(fp, m, m->emails[i], MUTT_CM_UPDATE,
* will be wrong, so update what we can, which is the offset of this
* message, and the offset of the body. If this is a multipart message,
* we just flush the in memory cache so that the message will be reparsed
- * if the user accesses it later.
- */
+ * if the user accesses it later. */
new_offset[i - first].body = ftello(fp) - m->emails[i]->content->length + offset;
mutt_body_free(&m->emails[i]->content->parts);
else
{
/* copy the temp mailbox back into place starting at the first
- * change/deleted message
- */
+ * change/deleted message */
if (!m->quiet)
mutt_message(_("Committing changes..."));
i = mutt_file_copy_stream(fp, adata->fp);
if ((mutt_file_fclose(&adata->fp) != 0) || (i == -1))
{
- /* error occurred while writing the mailbox back, so keep the temp copy
- * around
- */
+ /* error occurred while writing the mailbox back, so keep the temp copy around */
char savefile[PATH_MAX];
{
/* need to restore the times here, the file was not really accessed,
* only the type was accessed. This is important, because detection
- * of "new mail" depends on those times set correctly.
- */
+ * of "new mail" depends on those times set correctly. */
#ifdef HAVE_UTIMENSAT
struct timespec ts[2];
mutt_file_get_stat_timespec(&ts[0], &st, MUTT_STAT_ATIME);
{
/* On a REDRAW_FULL with a non-customized redraw, menu_redraw()
* will return OP_REDRAW to give the calling menu-loop a chance to
- * customize output.
- */
+ * customize output. */
menu_redraw(current_menu);
}
}
}
/* Clear the tag prefix unless we just started it. Don't clear
- * the prefix on a timeout (i==-2), but do clear on an abort (i==-1)
- */
+ * the prefix on a timeout (i==-2), but do clear on an abort (i==-1) */
if (menu->tagprefix && (i != OP_TAG_PREFIX) && (i != OP_TAG_PREFIX_COND) && (i != -2))
menu->tagprefix = false;
char scratch[128];
/* Don't modify our argument. Fixed-size buffer is ok here since
- * the date format imposes a natural limit.
- */
+ * the date format imposes a natural limit. */
mutt_str_strfcpy(scratch, s, sizeof(scratch));
case 4: /* timezone */
/* sometimes we see things like (MST) or (-0700) so attempt to
- * compensate by uncommenting the string if non-RFC822 compliant
- */
+ * compensate by uncommenting the string if non-RFC822 compliant */
ptz = uncomment_timezone(tzstr, sizeof(tzstr), t);
if ((*ptz == '+') || (*ptz == '-'))
* source symlink. It might be more correct to use stat() on src.
* I am not doing so to minimize changes in behavior: the function
* used lstat() further below for 20 years without issue, and I
- * believe was never intended to be used on a src symlink.
- */
+ * believe was never intended to be used on a src symlink. */
if ((lstat(src, &ssb) == 0) && (lstat(target, &tsb) == 0) &&
(compare_stat(&ssb, &tsb) == 0))
{
* on filesystems that don't properly support hard links, such as sshfs. The
* filesystem creates the link, but the resulting file is given a different
* inode number by the sshfs layer. This results in an infinite loop
- * creating links.
- */
+ * creating links. */
#if 0
/* Stat both links and check if they are equal. */
if (lstat(src, &ssb) == -1)
* 1) assert(0) or return NULL to signal error
* 2) copy as much of the path as will fit
* It doesn't appear that the return value is actually checked anywhere mutt_path_concat()
- * is called, so we should just copy set dst to nul and let the calling function fail later.
- */
+ * is called, so we should just copy set dst to nul and let the calling function fail later. */
dst[0] = '\0'; /* safe since we bail out early if dstlen == 0 */
return NULL;
}
* now we're supporting removals, which means we're supporting
* re-adds conceptually. So we probably want this to imply a
* removal, then do an add. We can achieve the removal by freeing
- * the template, and leaving t pointed at the current item.
- */
+ * the template, and leaving t pointed at the current item. */
FREE(&np->template);
break;
}
}
/* If np is set, it's pointing into an extant ReplaceList* that we want to
- * update. Otherwise we want to make a new one to link at the rl's end.
- */
+ * update. Otherwise we want to make a new one to link at the rl's end. */
if (np)
{
mutt_regex_free(&rx);
/* Viewing from a received message.
*
* Don't use mutt_save_attachment() because we want to perform charset
- * conversion since this will be displayed by the internal pager.
- */
+ * conversion since this will be displayed by the internal pager. */
struct State decode_state = { 0 };
decode_state.fp_out = mutt_file_fopen(pagerfile, "w");
{
/* in compose mode, just copy the file. we can't use
* mutt_decode_attachment() since it assumes the content-encoding has
- * already been applied
- */
+ * already been applied */
if (mutt_save_attachment(fp, a, pagerfile, MUTT_SAVE_NO_FLAGS, NULL))
goto return_error;
}
b->description = mutt_str_strdup(b->description);
/* we don't seem to need the Header structure currently.
- * XXX this may change in the future
- */
+ * XXX this may change in the future */
if (b->email)
b->email = NULL;
mutt_expand_aliases_env(msg->env);
/* search through the user defined headers added to see if
- * fcc: or attach: or pgp: was specified
- */
+ * fcc: or attach: or pgp: was specified */
struct ListNode *np, *tmp;
STAILQ_FOREACH_SAFE(np, &msg->env->userhdrs, entries, tmp)
void mutt_make_label_hash(struct Mailbox *m)
{
/* 131 is just a rough prime estimate of how many distinct
- * labels someone might have in a m.
- */
+ * labels someone might have in a m. */
m->label_hash = mutt_hash_new(131, MUTT_HASH_STRDUP_KEYS);
}
/* Setting dialog != NULL overrides normal menu behavior.
* In dialog mode menubar is hidden and prompt keys are checked before
* normal menu movement keys. This can cause problems with scrolling, if
- * prompt keys override movement keys.
- */
+ * prompt keys override movement keys. */
char **dialog; /**< dialog lines themselves */
char *prompt; /**< prompt for user, similar to mutt_multi_choice */
char *keys; /**< keys used in the prompt */
}
/* If this body isn't scheduled for enumeration already, don't bother
- * profiling it further.
- */
+ * profiling it further. */
if (shallcount)
{
/* Turn off shallcount if message type is not in ok list,
* or if it is in except list. Check is done separately for
- * inlines vs. attachments.
- */
+ * inlines vs. attachments. */
if (bp->disposition == DISP_ATTACH)
{
* are in blocking mode, SLsys_getkey() will not return an error unless
* a handler function is defined and it returns -1. This is needed so
* that if the user resizes the screen while at a prompt, it will just
- * abort and go back to the main-menu.
- */
+ * abort and go back to the main-menu. */
SLang_getkey_intr_hook = mutt_intr_hook;
#endif
}
struct MuttThread *nextdisp = NULL, *pseudo = NULL, *parent = NULL, *tree = ctx->tree;
/* Do the visibility calculations and free the old thread chars.
- * From now on we can simply ignore invisible subtrees
- */
+ * From now on we can simply ignore invisible subtrees */
calculate_visibility(ctx, &max_depth);
pfx = mutt_mem_malloc(width * max_depth + 2);
arrow = mutt_mem_malloc(width * max_depth + 2);
&(*((struct MuttThread **) b))->sort_key);
}
/* a hack to let us reset sort_func even though we can't
- * have extra arguments because of qsort
- */
+ * have extra arguments because of qsort */
else
{
sort_func = mutt_get_sort_func(C_Sort & SORT_MASK);
/* we put things into the array backwards to save some cycles,
* but we want to have to move less stuff around if we're
* resorting, so we sort backwards and then put them back
- * in reverse order so they're forwards
- */
+ * in reverse order so they're forwards */
C_Sort ^= SORT_REVERSE;
if (compare_threads(NULL, NULL) == 0)
return thread;
* data that we have. otherwise, use the first reference
* if it's different than the first in-reply-to, otherwise use
* the second reference (since at least eudora puts the most
- * recent reference in in-reply-to and the rest in references)
- */
+ * recent reference in in-reply-to and the rest in references) */
if (STAILQ_EMPTY(&cur->env->references))
ref = STAILQ_NEXT(ref, entries);
else
* The user agent interpreting a mailto URL SHOULD choose not to create
* a message if any of the headers are considered dangerous; it may also
* choose to create a message with only a subset of the headers given in
- * the URL.
- */
+ * the URL. */
if (mutt_list_match(tag, &MailToAllow))
{
if (mutt_str_strcasecmp(tag, "body") == 0)
if (strstr(p, "//") || strstr(p, "/./"))
{
/* first attempt to collapse the pathname, this is more
- * lightweight than realpath() and doesn't resolve links
- */
+ * lightweight than realpath() and doesn't resolve links */
while (*p)
{
if ((*p == '/') && (p[1] == '/'))
/* buflen is decremented at the start of this function
* to save space for the terminal nul char. We can add
* it back for the recursive call since the expansion of
- * format pipes does not try to append a nul itself.
- */
+ * format pipes does not try to append a nul itself. */
mutt_expando_format(buf, buflen + 1, col, cols, recycler,
callback, data, flags);
FREE(&recycler);
/* if the user has a 'push' command in their .neomuttrc, or in a folder-hook,
* it will cause the progress messages not to be displayed because
* mutt_refresh() will think we are in the middle of a macro. so set a
- * flag to indicate that we should really refresh the screen.
- */
+ * flag to indicate that we should really refresh the screen. */
OptForceRefresh = true;
if (!m->quiet)
}
/* There is no point in asking whether or not to purge if we are
- * just marking messages as "trash".
- */
+ * just marking messages as "trash". */
if ((m->msg_deleted != 0) && !((m->magic == MUTT_MAILDIR) && C_MaildirTrash))
{
snprintf(buf, sizeof(buf),
* sort order in order to synchronize folders.
*
* MH and maildir are safe. mbox-style seems to need re-sorting,
- * at least with the new threading code.
- */
+ * at least with the new threading code. */
if (purge || ((m->magic != MUTT_MAILDIR) && (m->magic != MUTT_MH)))
{
/* IMAP does this automatically after handling EXPUNGE */
}
/* Netscape 4.7 uses
* Content-Description: S/MIME Encrypted Message
- * instead of Content-Type parameter
- */
+ * instead of Content-Type parameter */
if (mutt_str_strcasecmp(m->description, "S/MIME Encrypted Message") == 0)
return SMIME_ENCRYPT;
complain = true;
char *self_encrypt = NULL;
/* Do a quick check to make sure that we can find all of the encryption
- * keys if the user has requested this service.
- */
+ * keys if the user has requested this service. */
if (!WithCrypto)
return 0;
tstr[len] = 0;
/* fromcode "utf-8" is sure, so we don't want
- * charset-hook corrections: flags must be 0.
- */
+ * charset-hook corrections: flags must be 0. */
mutt_ch_convert_string(&tstr, "utf-8", C_Charset, 0);
fputs(tstr, fp);
FREE(&tstr);
return NULL;
}
/* Check for zero signatures generated. This can occur when $pgp_sign_as is
- * unset and there is no default key specified in ~/.gnupg/gpg.conf
- */
+ * unset and there is no default key specified in ~/.gnupg/gpg.conf */
sigres = gpgme_op_sign_result(ctx);
if (!sigres->signatures)
{
goto leave;
}
/* Note that the stream, "fp_in", needs to be kept open while the keydata
- * is used.
- */
+ * is used. */
gpgme_error_t err = gpgme_data_new_from_stream(&keydata, fp_in);
if (err != GPG_ERR_NO_ERROR)
{
/* fromcode comes from the MIME Content-Type charset label. It might
* be a wrong label, so we want the ability to do corrections via
- * charset-hooks. Therefore we set flags to MUTT_ICONV_HOOK_FROM.
- */
+ * charset-hooks. Therefore we set flags to MUTT_ICONV_HOOK_FROM. */
struct FgetConv *fc = mutt_ch_fgetconv_open(fp, charset, C_Charset, MUTT_ICONV_HOOK_FROM);
for (complete = true, armor_header = true;
/* Now, copy cleartext to the screen. NOTE - we expect that PGP
* outputs utf-8 cleartext. This may not always be true, but it
- * seems to be a reasonable guess.
- */
+ * seems to be a reasonable guess. */
if (s->flags & MUTT_DISPLAY)
{
if (needpass)
/* if a multipart/signed is the _only_ sub-part of a
* multipart/encrypted, cache signature verification
- * status.
- */
+ * status. */
if (mutt_is_multipart_signed(tattach) && !tattach->next)
a->goodsig |= tattach->goodsig;
}
/* if a multipart/signed is the _only_ sub-part of a multipart/encrypted,
- * cache signature verification status.
- */
+ * cache signature verification status. */
if (mutt_is_multipart_signed(tattach) && !tattach->next)
{
a->goodsig = tattach->goodsig;
else if (the_strong_valid_key && !multi)
{
/* There was precisely one strong match on a valid ID.
- * Proceed without asking the user.
- */
+ * Proceed without asking the user. */
k = crypt_copy_key(the_strong_valid_key);
}
else
{
/* Assume address is 'mailbox@domainname'.
* The mailbox part is case-sensitive,
- * the domainname is not. (RFC2821)
- */
+ * the domainname is not. (RFC2821) */
const char *tmp_email = uid->email + 1;
const char *tmp_sender = sender->mailbox;
/* length of mailbox part including '@' */
* We allow an empty field for a pub record type because it is
* possible for a primary uid record to have an empty User-ID
* field. Without any address records, it is not possible to
- * use the key in neomutt.
- */
+ * use the key in neomutt. */
if (!(pend && (*p || is_pub)))
break;
/* fromcode comes from the MIME Content-Type charset label. It might
* be a wrong label, so we want the ability to do corrections via
- * charset-hooks. Therefore we set flags to MUTT_ICONV_HOOK_FROM.
- */
+ * charset-hooks. Therefore we set flags to MUTT_ICONV_HOOK_FROM. */
struct FgetConv *fc =
mutt_ch_fgetconv_open(fp_in, charset, C_Charset, MUTT_ICONV_HOOK_FROM);
* so we need to be more selective about the value of decrypt_okay_rc.
*
* -3 indicates we actively found a DECRYPTION_FAILED.
- * -2 and -1 indicate part or all of the content was plaintext.
- */
+ * -2 and -1 indicate part or all of the content was plaintext. */
if (needpass)
{
rewind(fp_pgp_err);
/* Sig is bad if
* gpg_good_sign-pattern did not match || pgp_decode_command returned not 0
* Sig _is_ correct if
- * gpg_good_sign="" && pgp_decode_command returned 0
- */
+ * gpg_good_sign="" && pgp_decode_command returned 0 */
if ((rc == -1) || rv)
maybe_goodsig = false;
}
/* Multiple PGP blocks can exist, so these need to be closed and
- * unlinked inside the loop.
- */
+ * unlinked inside the loop. */
mutt_file_fclose(&fp_tmp);
mutt_file_unlink(tmpfname);
mutt_file_fclose(&fp_pgp_out);
}
/* Position the stream at the beginning of the body, and send the data to
- * the temporary file.
- */
+ * the temporary file. */
fseeko(s->fp_in, a->offset, SEEK_SET);
mutt_file_copy_bytes(s->fp_in, fp_pgp_tmp, a->length);
/* if a multipart/signed is the _only_ sub-part of a
* multipart/encrypted, cache signature verification
- * status.
- */
+ * status. */
if (mutt_is_multipart_signed(tattach) && !tattach->next)
a->goodsig |= tattach->goodsig;
mutt_file_fclose(&fp_pgp_in);
/* Read back the PGP signature. Also, change MESSAGE=>SIGNATURE as
- * recommended for future releases of PGP.
- */
+ * recommended for future releases of PGP. */
while (fgets(buf, sizeof(buf) - 1, fp_pgp_out))
{
if (mutt_str_strcmp("-----BEGIN PGP MESSAGE-----\n", buf) == 0)
/* The following code is really correct: If noconv is set,
* a's charset parameter contains the on-disk character set, and
* we have to convert from that to utf-8. If noconv is not set,
- * we have to convert from $charset to utf-8.
- */
+ * we have to convert from $charset to utf-8. */
mutt_body_get_charset(a, body_charset, sizeof(body_charset));
if (a->noconv)
/* Opportunistic encrypt is controlling encryption. Allow to toggle
* between inline and mime, but not turn encryption on or off.
* NOTE: "Signing" and "Clearing" only adjust the sign bit, so we have different
- * letter choices for those.
- */
+ * letter choices for those. */
if (C_CryptOpportunisticEncrypt && (msg->security & SEC_OPPENCRYPT))
{
if (msg->security & (SEC_ENCRYPT | SEC_SIGN))
}
}
/* Opportunistic encryption option is set, but is toggled off
- * for this message.
- */
+ * for this message. */
else if (C_CryptOpportunisticEncrypt)
{
/* When the message is not selected for signing or encryption, the toggle
- * between PGP/MIME and Traditional doesn't make sense.
- */
+ * between PGP/MIME and Traditional doesn't make sense. */
if (msg->security & (SEC_ENCRYPT | SEC_SIGN))
{
snprintf(promptbuf, sizeof(promptbuf),
else if (the_strong_valid_key && !multi)
{
/* There was precisely one strong match on a valid ID.
- * Proceed without asking the user.
- */
+ * Proceed without asking the user. */
pgp_remove_key(&matches, the_strong_valid_key);
k = the_strong_valid_key;
}
continue;
/* This shouldn't happen, but keys without any addresses aren't selectable
- * in pgp_select_key().
- */
+ * in pgp_select_key(). */
if (!k->address)
continue;
* - First free all children.
* - If we are an orphan (i.e., our parent was not in the key list),
* free our parent.
- * - free ourselves.
- */
+ * - free ourselves. */
for (p = *kpp; p; p = q)
{
{
/* Some users manually maintain their .index file, and use a tab
* as a delimiter, which the old parsing code (using fscanf)
- * happened to allow. smime_keys uses a space, so search for both.
- */
+ * happened to allow. smime_keys uses a space, so search for both. */
if ((pend = strchr(p, ' ')) || (pend = strchr(p, '\t')) || (pend = strchr(p, '\n')))
*pend++ = 0;
/* For backward compatibility, don't count consecutive delimiters
- * as an empty field.
- */
+ * as an empty field. */
if (!*p)
continue;
return -1;
}
/* decoding the attachment changes the size and offset, so save a copy
- * of the "real" values now, and restore them after processing
- */
+ * of the "real" values now, and restore them after processing */
tmplength = sigbdy->length;
tmpoffset = sigbdy->offset;
/* if we are decoding binary bodies, we don't want to prefix each
- * line with the prefix or else the data will get corrupted.
- */
+ * line with the prefix or else the data will get corrupted. */
char *save_prefix = s->prefix;
s->prefix = NULL;
/* Opportunistic encrypt is controlling encryption.
* NOTE: "Signing" and "Clearing" only adjust the sign bit, so we have different
- * letter choices for those.
- */
+ * letter choices for those. */
if (C_CryptOpportunisticEncrypt && (msg->security & SEC_OPPENCRYPT))
{
/* L10N: S/MIME options (opportunistic encryption is on) */
choices = "SwaCo";
}
/* Opportunistic encryption option is set, but is toggled off
- * for this message.
- */
+ * for this message. */
else if (C_CryptOpportunisticEncrypt)
{
/* L10N: S/MIME options (opportunistic encryption is off) */
/* if a date part is defined, do not apply windows (to avoid the risk of
* having a non-intersected date frame). A good improvement would be to
- * accept if they intersect
- */
+ * accept if they intersect */
if (!strstr(mdata->db_query, "date:") &&
windowed_query_from_query(mdata->db_query, buf, sizeof(buf)))
{
e->free_edata = nm_edata_free;
/* Notmuch ensures that message Id exists (if not notmuch Notmuch will
- * generate an ID), so it's more safe than use neomutt Email->env->id
- */
+ * generate an ID), so it's more safe than use neomutt Email->env->id */
const char *id = notmuch_message_get_message_id(msg);
edata->virtual_id = mutt_str_strdup(id);
return -1;
/* note that unlink() is probably unnecessary here, it's already removed
- * by mh_sync_mailbox_message(), but for sure...
- */
+ * by mh_sync_mailbox_message(), but for sure... */
notmuch_filenames_t *ls = NULL;
st = notmuch_database_remove_message(db, path);
switch (st)
e->active = true;
/* Check to see if the message has moved to a different subdirectory.
- * If so, update the associated filename.
- */
+ * If so, update the associated filename. */
new = get_message_last_filename(msg);
email_get_fullpath(e, old, sizeof(old));
if (!e->changed)
{
- /* if the user hasn't modified the flags on
- * this message, update the flags we just
- * detected.
- */
+ /* if the user hasn't modified the flags on this message, update the
+ * flags we just detected. */
struct Email tmp = { 0 };
maildir_parse_flags(&tmp, new);
maildir_update_flags(m, e, &tmp);
/* next class to test; if tmp is a shorter prefix for another
* node, that node can only be in the top level list, so don't
- * go down after this point
- */
+ * go down after this point */
q_list = tmp->next;
}
else
/* When this option is unset, we color the entire header the
* same color. Otherwise, we handle the header patterns just
- * like body patterns (further below).
- */
+ * like body patterns (further below). */
if (!C_HeaderColorPartial)
{
STAILQ_FOREACH(color_line, &ColorHdrList, entries)
* don't want to compute it every time MUTT_TYPES is set, since this
* would slow down the "bottom" function unacceptably. A compromise
* solution is hence to call regexec() again, just to find out the
- * length of the quote prefix.
- */
+ * length of the quote prefix. */
if ((flags & MUTT_SHOWCOLOR) && !(*line_info)[n].continuation &&
((*line_info)[n].type == MT_COLOR_QUOTED) && !(*line_info)[n].quote)
{
/* Fill the blank space at the end of the line with the prevailing color.
* ncurses does an implicit clrtoeol() when you do addch('\n') so we have
- * to make sure to reset the color *after* that
- */
+ * to make sure to reset the color *after* that */
if (flags & MUTT_SHOWCOLOR)
{
m = ((*line_info)[n].continuation) ? ((*line_info)[n].syntax)[0].first : n;
/* reset the color back to normal. This *must* come after the
* clrtoeol, otherwise the color for this line will not be
- * filled to the right margin.
- */
+ * filled to the right margin. */
if (flags & MUTT_SHOWCOLOR)
NORMAL_COLOR;
/* --------------------------------------------------------------------
* The following are operations on the current message rather than
- * adjusting the view of the message.
- */
+ * adjusting the view of the message. */
case OP_BOUNCE_MESSAGE:
{
bool skip_quote = false;
/* If simple_search is set to "~m %s", the range will have double quotes
- * around it...
- */
+ * around it... */
if (*s->dptr == '"')
{
s->dptr++;
}
/* If simple_search is set to "~m %s", the range will have double quotes
- * around it...
- */
+ * around it... */
if (*s->dptr == '"')
{
s->dptr++;
/* m can be NULL in certain cases, such as when replying to a message
* from the attachment menu and the user has a reply-hook using "~e" (bug
* #2190).
- * This is also the case when message scoring.
- */
+ * This is also the case when message scoring. */
if (!m)
return 0;
#ifdef USE_IMAP
}
/* XXX - is mutt_str_strcasecmp() right here, or should we use locale's
- * equivalences?
- */
+ * equivalences? */
if (do_simple) /* yup, so spoof a real request */
{
}
/* message not found in context -> remove it from cache
- * return the result of bcache, so we stop upon its first error
- */
+ * return the result of bcache, so we stop upon its first error */
return mutt_bcache_del(bcache, cache_id(id));
}
* - e->data needs to a separate pointer as it's driver-specific
* data freed separately elsewhere
* (the old e->data should point inside a malloc'd block from
- * hcache so there shouldn't be a memleak here)
- */
+ * hcache so there shouldn't be a memleak here) */
struct Email *e = mutt_hcache_restore((unsigned char *) data);
mutt_hcache_free(hc, &data);
mutt_email_free(&m->emails[i]);
* folder and not when opening it XXX)
* - if 'hcached' is false, we don't have the message in our hcache:
* - if we also have a body: read
- * - if we don't have a body: new
- */
+ * - if we don't have a body: new */
const bool bcached =
(mutt_bcache_exists(adata->bcache, cache_id(edata->uid)) == 0);
m->emails[i]->old = false;
/* after putting the result into our structures,
* clean up cache, i.e. wipe messages deleted outside
- * the availability of our cache
- */
+ * the availability of our cache */
if (C_MessageCacheClean)
mutt_bcache_list(adata->bcache, msg_cache_check, m);
return 0;
/* see if we already have the message in our cache in
- * case $message_cachedir is unset
- */
+ * case $message_cachedir is unset */
struct PopCache *cache = &adata->cache[e->index % POP_CACHE_LEN];
if (cache->path)
}
/* Update the header information. Previously, we only downloaded a
- * portion of the headers, those required for the main display.
- */
+ * portion of the headers, those required for the main display. */
if (bcache)
mutt_bcache_commit(adata->bcache, cache_id(edata->uid));
else
/* About client_start: If sasl_client_start() returns data via pc/olen,
* the client is expected to send this first (after the AUTH string is sent).
- * sasl_client_start() may in fact return SASL_OK in this case.
- */
+ * sasl_client_start() may in fact return SASL_OK in this case. */
client_start = olen;
mutt_message(_("Authenticating (SASL)..."));
/* Note we don't exit if rc==SASL_OK when client_start is true.
* This is because the first loop has only sent the AUTH string, we
* need to loop at least once more to send the pc/olen returned
- * by sasl_client_start().
- */
+ * by sasl_client_start(). */
if (!client_start && (rc != SASL_CONTINUE))
break;
}
/* Even if sasl_client_step() returns SASL_OK, we should send at
- * least one more line to the server. See #3862.
- */
+ * least one more line to the server. See #3862. */
if ((rc != SASL_CONTINUE) && (rc != SASL_OK))
break;
/* note that x-mutt-fcc was present. we do this because we want to add a
* default fcc if the header was missing, but preserve the request of the
* user to not make a copy if the header field is present, but empty.
- * see http://dev.mutt.org/trac/ticket/3653
- */
+ * see http://dev.mutt.org/trac/ticket/3653 */
rc |= SEND_POSTPONED_FCC;
}
else if (((WithCrypto & APPLICATION_PGP) != 0) &&
/* This used to be the micalg parameter.
*
* It's no longer needed, so we just skip the parameter in order
- * to be able to recall old messages.
- */
+ * to be able to recall old messages. */
case 'm':
case 'M':
if (*(p + 1) == '<')
/* If resending a message, don't keep message_id or mail_followup_to.
* Otherwise, we are resuming a postponed message, and want to keep those
- * headers if they exist.
- */
+ * headers if they exist. */
if (resend)
{
FREE(&newhdr->env->message_id);
}
/* remove a potential multipart/signed layer - useful when
- * resending messages
- */
+ * resending messages */
if ((WithCrypto != 0) && mutt_is_multipart_signed(newhdr->content))
{
newhdr->security |= SEC_SIGN;
*
* XXX - we don't handle multipart/alternative in any
* smart way when sending messages. However, one may
- * consider this a feature.
- */
+ * consider this a feature. */
if (newhdr->content->type == TYPE_MULTIPART)
newhdr->content = mutt_remove_multipart(newhdr->content);
for (b = newhdr->content; b; b = b->next)
{
/* what follows is roughly a receive-mode variant of
- * mutt_get_tmp_attachment () from muttlib.c
- */
+ * mutt_get_tmp_attachment () from muttlib.c */
file[0] = '\0';
if (b->filename)
/* First, find the parent message.
* Note: This could be made an option by just
- * putting the following lines into an if block.
- */
+ * putting the following lines into an if block. */
struct AttachPtr *parent = find_parent(actx, cur, nattach);
if (parent)
{
* original message's header.
*
* The next part is more interesting: either include the message bodies,
- * or attach them.
- */
+ * or attach them. */
if ((!cur || mutt_can_decode(cur)) &&
((ans = query_quadoption(C_MimeForward, _("Forward as attachments?"))) == MUTT_YES))
{
}
/* shortcut MIMEFWDREST when there is only one attachment.
- * Is this intuitive?
- */
+ * Is this intuitive? */
if (!mime_fwd_all && !cur && (nattach > 1) && !check_can_decode(actx, cur))
{
ans = query_quadoption(
* extradefs are of the form:
* def1="definition"; def2="define \;";
* line wraps with a \ at the end of the line
- * # for comments
- */
+ * # for comments */
/* find length of basetype */
char *ch = strchr(type, '/');
else if ((plen = mutt_str_startswith(field, "test", CASE_IGNORE)))
{
/* This routine executes the given test command to determine
- * if this is the right entry.
- */
+ * if this is the right entry. */
char *test_command = NULL;
if (get_field_text(field + plen, &test_command, type, filename, line) && test_command)
* joy. They say
* $HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap, etc
* and overridden by the MAILCAPS environment variable, and, just to be nice,
- * we'll make it specifiable in .neomuttrc
- */
+ * we'll make it specifiable in .neomuttrc */
if (!curr || !*curr)
{
mutt_error(_("No mailcap path specified"));
* thus the i + 2.
* - If there was a left hand match, this stuff
* must not be counted again. That's done by the
- * condition (j >= (lmatch ? i : 0)).
- */
+ * condition (j >= (lmatch ? i : 0)). */
rmatch = true;
static int space_quotes(struct State *s)
{
/* Allow quote spacing in the pager even for C_TextFlowed,
- * but obviously not when replying.
- */
+ * but obviously not when replying. */
if (C_TextFlowed && (s->flags & MUTT_REPLYING))
return 0;
if (s->prefix)
{
/* use given prefix only for format=fixed replies to format=flowed,
- * for format=flowed replies to format=flowed, use '>' indentation
- */
+ * for format=flowed replies to format=flowed, use '>' indentation */
if (C_TextFlowed)
ql++;
else
const unsigned int newql = get_quote_level(buf);
/* end flowed paragraph (if we're within one) if quoting level
- * changes (should not but can happen, see RFC3676, sec. 4.5.)
- */
+ * changes (should not but can happen, see RFC3676, sec. 4.5.) */
if (newql != quotelevel)
flush_par(s, &fst);
va_end(ap);
/* GNU libc man page for vasprintf(3) states that the value of *strp
- * is undefined when the return code is -1.
- */
+ * is undefined when the return code is -1. */
if (n < 0)
{
mutt_error(_("Out of memory"));
if (n < rlen)
{
/* reduce space to just that which was used. note that 'n' does not
- * include the terminal nul char.
- */
+ * include the terminal nul char. */
if (n == 0) /* convention is to use NULL for zero-length strings. */
FREE(strp);
else if (n != rlen - 1)
{
/* 'buf' arg was cleared and 'pattern' holds the only reference;
* as here 'ptr' != NULL -> update the value only in which case
- * ptr->str already has the string, so pattern should be freed.
- */
+ * ptr->str already has the string, so pattern should be freed. */
FREE(&pattern);
}
pc = buf->data;
}
/* Exit now if we're setting up the default Cc list for list-reply
- * (only set if Mail-Followup-To is present and honoured).
- */
+ * (only set if Mail-Followup-To is present and honoured). */
if (flags & SEND_LIST_REPLY)
return 0;
/* There are quite a few mailing lists which set the Reply-To:
* header field to the list address, which makes it quite impossible
* to send a message to only the sender of the message. This
- * provides a way to do that.
- */
+ * provides a way to do that. */
/* L10N: Asks whether the user respects the reply-to header.
If she says no, neomutt will reply to the from header's address instead. */
snprintf(prompt, sizeof(prompt), _("Reply to %s%s?"),
if (!C_Metoo)
{
/* the order is important here. do the CC: first so that if the
- * the user is the only recipient, it ends up on the TO: field
- */
+ * the user is the only recipient, it ends up on the TO: field */
env->cc = remove_user(env->cc, (env->to == NULL));
env->to = remove_user(env->to, (env->cc == NULL) || C_ReplySelf);
}
return;
/* This takes precedence over a subject that might have
- * been taken from a List-Post header. Is that correct?
- */
+ * been taken from a List-Post header. Is that correct? */
if (curenv->real_subj)
{
FREE(&env->subject);
struct Address *from = NULL;
/* Only generate the Mail-Followup-To if the user has requested it, and
- * it hasn't already been set
- */
+ * it hasn't already been set */
if (!C_FollowupTo)
return;
if (mutt_is_list_cc(0, env->to, env->cc))
{
/* this message goes to known mailing lists, so create a proper
- * mail-followup-to header
- */
+ * mail-followup-to header */
t = mutt_addr_append(&env->mail_followup_to, env->to, false);
mutt_addr_append(&t, env->cc, true);
/* remove ourselves from the mail-followup-to header */
env->mail_followup_to = remove_user(env->mail_followup_to, false);
- /* If we are not subscribed to any of the lists in question,
- * re-add ourselves to the mail-followup-to header. The
- * mail-followup-to header generated is a no-op with group-reply,
- * but makes sure list-reply has the desired effect.
- */
+ /* If we are not subscribed to any of the lists in question, re-add
+ * ourselves to the mail-followup-to header. The mail-followup-to header
+ * generated is a no-op with group-reply, but makes sure list-reply has the
+ * desired effect. */
if (env->mail_followup_to && !mutt_is_list_recipient(false, env->to, env->cc))
{
{
tmp = mutt_addr_copy(tmp);
/* when $reverse_realname is not set, clear the personal name so that it
- * may be set via a reply- or send-hook.
- */
+ * may be set via a reply- or send-hook. */
if (!C_ReverseRealname)
FREE(&tmp->personal);
}
}
/* make sure the message is written to the right part of a maildir
- * postponed folder.
- */
+ * postponed folder. */
msg->read = false;
msg->old = false;
mutt_num_postponed(ctx ? ctx->mailbox : NULL, true))
{
/* If the user is composing a new message, check to see if there
- * are any postponed messages first.
- */
+ * are any postponed messages first. */
enum QuadOption ans =
query_quadoption(C_Recall, _("Recall postponed message?"));
if (ans == MUTT_ABORT)
/* Delay expansion of aliases until absolutely necessary--shouldn't
* be necessary unless we are prompting the user or about to execute a
- * send-hook.
- */
+ * send-hook. */
if (!msg)
{
flags = rc;
#ifdef USE_NNTP
/* If postponed message is a news article, it have
- * a "Newsgroups:" header line, then set appropriate flag.
- */
+ * a "Newsgroups:" header line, then set appropriate flag. */
if (msg->env->newsgroups)
{
flags |= SEND_NEWS;
if (!(flags & (SEND_KEY | SEND_POSTPONED | SEND_RESEND)))
{
/* When SEND_DRAFT_FILE is set, the caller has already
- * created the "parent" body structure.
- */
+ * created the "parent" body structure. */
if (!(flags & SEND_DRAFT_FILE))
{
pbody = mutt_body_new();
* either replying to a real or postponed message, therefore no aliases
* should exist since the user has not had the opportunity to add
* addresses to the list. We just have to ensure the postponed messages
- * have their aliases expanded.
- */
+ * have their aliases expanded. */
if (msg->env->from)
{
*
* If there is already a from address recorded in 'msg->env->from',
* then it theoretically comes from C_ReverseName handling, and we don't use
- * the 'X-Orig-To header'.
- */
+ * the 'X-Orig-To header'. */
if (cur->env->x_original_to && !msg->env->from)
{
msg->env->from = mutt_addr_copy(cur->env->x_original_to);
/* set the replied flag for the message we are generating so that the
* user can use ~Q in a send-hook to know when reply-hook's are also
- * being used.
- */
+ * being used. */
msg->replied = true;
}
/* Unset the replied flag from the message we are composing since it is
* no longer required. This is done here because the FCC'd copy of
* this message was erroneously get the 'R'eplied flag when stored in
- * a maildir-style mailbox.
- */
+ * a maildir-style mailbox. */
msg->replied = false;
if (!(flags & SEND_KEY))
/* This hook is even called for postponed messages, and can, e.g., be
* used for setting the editor, the sendmail path, or the
- * envelope sender.
- */
+ * envelope sender. */
mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
/* wait until now to set the real name portion of our return address so
* This is controlled by the quadoption $forward_edit. However, if
* both $edit_headers and $autoedit are set, we want to ignore the
* setting of $forward_edit because the user probably needs to add the
- * recipients.
- */
+ * recipients. */
if (!(flags & SEND_KEY) &&
(((flags & SEND_FORWARD) == 0) || (C_EditHeaders && C_Autoedit) ||
(query_quadoption(C_ForwardEdit, _("Edit forwarded message?")) == MUTT_YES)))
/* If using format=flowed, perform space stuffing. Avoid stuffing when
* recalling a postponed message where the stuffing was already
* performed. If it has already been performed, the format=flowed
- * parameter will be present.
- */
+ * parameter will be present. */
if (C_TextFlowed && (msg->content->type == TYPE_TEXT) &&
(mutt_str_strcasecmp("plain", msg->content->subtype) == 0))
{
* 6) we are in batch mode
*
* This is done after allowing the user to edit the message so that security
- * settings can be configured with send2-hook and $edit_headers.
- */
+ * settings can be configured with send2-hook and $edit_headers. */
if ((WithCrypto != 0) && (msg->security == 0) &&
!(flags & (SEND_BATCH | SEND_MAILX | SEND_POSTPONED | SEND_RESEND)))
{
*
* Problem: At least with forwarding, this doesn't really
* make much sense. Should we have an option to completely
- * disable individual mechanisms at run-time?
- */
+ * disable individual mechanisms at run-time? */
if (cur)
{
if (((WithCrypto & APPLICATION_PGP) != 0) && C_CryptAutopgp &&
}
/* No crypto mechanism selected? Use availability + smime_is_default
- * for the decision.
- */
+ * for the decision. */
if (!(msg->security & (APPLICATION_SMIME | APPLICATION_PGP)))
{
if (((WithCrypto & APPLICATION_SMIME) != 0) && C_CryptAutosmime && C_SmimeIsDefault)
{
/* If something has already enabled encryption, e.g. C_CryptAutoencrypt
* or C_CryptReplyencrypt, then don't enable opportunistic encrypt for
- * the message.
- */
+ * the message. */
if (!(msg->security & SEC_ENCRYPT))
{
msg->security |= SEC_OPPENCRYPT;
/* Deal with the corner case where the crypto module backend is not available.
* This can happen if configured without pgp/smime and with gpgme, but
- * $crypt_use_gpgme is unset.
- */
+ * $crypt_use_gpgme is unset. */
if (msg->security && !crypt_has_module_backend(msg->security))
{
mutt_error(_(
/* Ok, we need to do it this way instead of handling all fcc stuff in
* one place in order to avoid going to main_loop with encoded "env"
- * in case of error. Ugh.
- */
+ * in case of error. Ugh. */
mutt_encode_descriptions(msg->content, true);
/* Make sure that clear_content and free_clear_content are
* properly initialized -- we may visit this particular place in
* the code multiple times, including after a failed call to
- * mutt_protect().
- */
+ * mutt_protect(). */
clear_content = NULL;
free_clear_content = false;
{
/* If the last character is "quoted", then be sure to move all three
* characters to the next line. Otherwise, just move the last
- * character...
- */
+ * character... */
if (line[linelen - 3] == '=')
{
line[linelen - 3] = 0;
else if ((c != 9) && ((c < 32) || (c > 126) || (c == '=')))
{
/* Check to make sure there is enough room for the quoted character.
- * If not, wrap to the next line.
- */
+ * If not, wrap to the next line. */
if (linelen > 73)
{
line[linelen++] = '=';
else
{
/* Don't worry about wrapping the line here. That will happen during
- * the next iteration when I'll also know what the next character is.
- */
+ * the next iteration when I'll also know what the next character is. */
line[linelen++] = c;
}
}
const int encode = rfc2231_encode_string(&tmp);
mutt_addr_cat(buf, sizeof(buf), tmp, MimeSpecials);
- /* Dirty hack to make messages readable by Outlook Express
- * for the Mac: force quotes around the boundary parameter
- * even when they aren't needed.
- */
+ /* Dirty hack to make messages readable by Outlook Express for the Mac:
+ * force quotes around the boundary parameter even when they aren't
+ * needed. */
if ((mutt_str_strcasecmp(np->attribute, "boundary") == 0) && (strcmp(buf, tmp) == 0))
{
for (int count = 0; count < 4; count++)
{
/* can't use strtok() because we use it in an inner loop below, so use
- * a switch statement here instead.
- */
+ * a switch statement here instead. */
switch (count)
{
/* last file with last entry to match wins type/xtype */
run_mime_type_query(att);
/* Attempt to determine the appropriate content-type based on the filename
- * suffix.
- */
+ * suffix. */
if (!att->subtype)
mutt_lookup_mime_type(att, path);
((info->lobin == 0) || ((info->lobin + info->hibin + info->ascii) / info->lobin >= 10)))
{
/* Statistically speaking, there should be more than 10% "lobin"
- * chars if this is really a binary file...
- */
+ * chars if this is really a binary file... */
att->type = TYPE_TEXT;
att->subtype = mutt_str_strdup("plain");
}
fputs(mutt_date_make_date(buf, sizeof(buf)), fp);
/* UseFrom is not consulted here so that we can still write a From:
- * field if the user sets it with the 'my_hdr' command
- */
+ * field if the user sets it with the 'my_hdr' command */
if (env->from && !privacy)
{
buf[0] = 0;
pid_t ppid = getppid();
/* we want the delivery to continue even after the main process dies,
- * so we put ourselves into another session right away
- */
+ * so we put ourselves into another session right away */
setsid();
/* next we close all open files */
/* C_SendmailWait > 0: interrupt waitpid() after C_SendmailWait seconds
* C_SendmailWait = 0: wait forever
- * C_SendmailWait < 0: don't wait
- */
+ * C_SendmailWait < 0: don't wait */
if (C_SendmailWait > 0)
{
SigAlrm = 0;
{
/* some MTA's will put an Apparently-To: header field showing the Bcc:
* recipients if there is no To: or Cc: field, so attempt to suppress
- * it by using an empty To: field.
- */
+ * it by using an empty To: field. */
env->to = mutt_addr_new();
env->to->group = 1;
env->to->next = mutt_addr_new();
* in $from, so we add it here. The reason it is not added in
* mutt_default_from() is that during normal sending, we execute
* send-hooks and set the realname last so that it can be changed based
- * upon message criteria.
- */
+ * upon message criteria. */
if (!from->personal)
from->personal = mutt_str_strdup(C_Realname);
/* prepare recipient list. idna conversion appears to happen before this
* function is called, since the user receives confirmation of the address
- * list being bounced to.
- */
+ * list being bounced to. */
struct Address *resent_to = mutt_addr_copy_list(to, false);
rfc2047_encode_addrlist(resent_to, "Resent-To");
}
/* We need to add a Content-Length field to avoid problems where a line in
- * the message body begins with "From "
- */
+ * the message body begins with "From " */
if ((ctx_fcc->mailbox->magic == MUTT_MMDF) || (ctx_fcc->mailbox->magic == MUTT_MBOX))
{
mutt_mktemp(tempfile, sizeof(tempfile));
}
/* post == 1 => postpone message.
- * post == 0 => Normal mode.
- */
+ * post == 0 => Normal mode. */
mutt_rfc822_write_header(
msg->fp, e->env, e->content, post ? MUTT_WRITE_HEADER_POSTPONE : MUTT_WRITE_HEADER_NORMAL,
false, C_CryptProtectedHeadersRead && mutt_should_hide_protected_subject(e));
* Message-ID: of message replied to. Save it using a special X-Mutt-
* header so it can be picked up if the message is recalled at a later
* point in time. This will allow the message to be marked as replied if
- * the same mailbox is still open.
- */
+ * the same mailbox is still open. */
if (post && msgid)
fprintf(msg->fp, "X-Mutt-References: %s\n", msgid);
/* (postponement) save the Fcc: using a special X-Mutt- header so that
- * it can be picked up when the message is recalled
- */
+ * it can be picked up when the message is recalled */
if (post && fcc)
fprintf(msg->fp, "X-Mutt-Fcc: %s\n", fcc);
#ifdef MIXMASTER
/* (postponement) if the mail is to be sent through a mixmaster
- * chain, save that information
- */
+ * chain, save that information */
if (post && !STAILQ_EMPTY(&e->chain))
{
mutt_write_mime_body(e->content, fp_tmp);
- /* make sure the last line ends with a newline. Emacs doesn't ensure
- * this will happen, and it can cause problems parsing the mailbox
- * later.
- */
+ /* make sure the last line ends with a newline. Emacs doesn't ensure this
+ * will happen, and it can cause problems parsing the mailbox later. */
fseek(fp_tmp, -1, SEEK_END);
if (fgetc(fp_tmp) != '\n')
{
snprintf(buf, sizeof(buf), "%s %s\r\n", esmtp ? "EHLO" : "HELO", fqdn);
/* XXX there should probably be a wrapper in mutt_socket.c that
* repeatedly calls conn->write until all data is sent. This
- * currently doesn't check for a short write.
- */
+ * currently doesn't check for a short write. */
if (mutt_socket_send(conn, buf) == -1)
return SMTP_ERR_WRITE;
return smtp_get_resp(conn);
{
/* this function gets called by mutt_sync_mailbox(), which may have just
* deleted all the messages. the virtual message numbers are not updated
- * in that routine, so we must make sure to zero the vcount member.
- */
+ * in that routine, so we must make sure to zero the vcount member. */
ctx->mailbox->vcount = 0;
ctx->vsize = 0;
mutt_clear_threads(ctx);