Commit 248c2ee8 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Clean up code indentation.

These are mostly automated changes corresponding to the emacs
settings:
  (c-set-style "linux")
  (setq c-basic-offset 2)
  (c-set-offset 'case-label '+)

Most of the code follows the convention:
  (add-to-list 'c-cleanup-list 'space-before-funcall)
but this is not enforced by this indentation cleanup.

Also, I personally dislike tabs, so I have:
  (setq-default indent-tabs-mode nil)
in my own configuration.  However I have no desire to change every line
just for that effect.  So this cleanup does nothing about the mix issue.

Some of the secondary files (e.g. regex.c) have been skipped.

I've also skipped crypt-gpgme.c, because I need to think about that
file.  Werner Koch and the GnuPG team contributed most it, and it
follows the Gnu indentation settings.  It should probably be made
uniform with Mutt, but I don't want to discourage future GnuPG
contribution to the file.

I manually reverted a few unsightly cleanups, and added a few tweeks
when I saw things that could be improved.
parent 085a6f74
Pipeline #42197293 (#403) passed with stages
in 2 minutes and 59 seconds
...@@ -388,7 +388,7 @@ retry_name: ...@@ -388,7 +388,7 @@ retry_name:
return; return;
fseek_err: fseek_err:
mutt_perror (_("Error seeking in alias file")); mutt_perror (_("Error seeking in alias file"));
safe_fclose (&rc); safe_fclose (&rc);
return; return;
......
...@@ -295,7 +295,7 @@ int mutt_edit_attachment (BODY *a) ...@@ -295,7 +295,7 @@ int mutt_edit_attachment (BODY *a)
rc = 1; rc = 1;
bailout: bailout:
if(unlink_newfile) if(unlink_newfile)
unlink(mutt_b2s (newfile)); unlink(mutt_b2s (newfile));
...@@ -313,15 +313,17 @@ void mutt_check_lookup_list (BODY *b, char *type, int len) ...@@ -313,15 +313,17 @@ void mutt_check_lookup_list (BODY *b, char *type, int len)
LIST *t = MimeLookupList; LIST *t = MimeLookupList;
int i; int i;
for (; t; t = t->next) { for (; t; t = t->next)
{
i = mutt_strlen (t->data) - 1; i = mutt_strlen (t->data) - 1;
if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' && if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' &&
ascii_strncasecmp (type, t->data, i) == 0) || ascii_strncasecmp (type, t->data, i) == 0) ||
ascii_strcasecmp (type, t->data) == 0) { ascii_strcasecmp (type, t->data) == 0)
{
BODY tmp = {0}; BODY tmp = {0};
int n; int n;
if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) { if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER)
{
snprintf (type, len, "%s/%s", snprintf (type, len, "%s/%s",
n == TYPEAUDIO ? "audio" : n == TYPEAUDIO ? "audio" :
n == TYPEAPPLICATION ? "application" : n == TYPEAPPLICATION ? "application" :
...@@ -607,7 +609,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, ...@@ -607,7 +609,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
else else
rc = 0; rc = 0;
return_error: return_error:
if (entry) if (entry)
rfc1524_free_entry (&entry); rfc1524_free_entry (&entry);
......
...@@ -157,7 +157,7 @@ FILE* mutt_bcache_put(body_cache_t *bcache, const char *id, int tmp) ...@@ -157,7 +157,7 @@ FILE* mutt_bcache_put(body_cache_t *bcache, const char *id, int tmp)
s = strchr (s + 1, '/'); s = strchr (s + 1, '/');
} }
out: out:
dprint (3, (debugfile, "bcache: put: '%s'\n", path)); dprint (3, (debugfile, "bcache: put: '%s'\n", path));
return fp; return fp;
......
...@@ -226,9 +226,15 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co ...@@ -226,9 +226,15 @@ folder_format_str (char *dest, size_t destlen, size_t col, int cols, char op, co
s = NONULL (folder->ff->name); s = NONULL (folder->ff->name);
snprintf (fn, sizeof (fn), "%s%s", s, snprintf (fn, sizeof (fn), "%s%s", s,
folder->ff->local ? (S_ISLNK (folder->ff->mode) ? "@" : folder->ff->local ?
(S_ISDIR (folder->ff->mode) ? "/" : (S_ISLNK (folder->ff->mode) ?
((folder->ff->mode & S_IXUSR) != 0 ? "*" : ""))) : ""); "@" :
(S_ISDIR (folder->ff->mode) ?
"/" :
((folder->ff->mode & S_IXUSR) != 0 ?
"*" :
""))) :
"");
mutt_format_s (dest, destlen, fmt, fn); mutt_format_s (dest, destlen, fmt, fn);
break; break;
...@@ -1324,7 +1330,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num ...@@ -1324,7 +1330,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
} }
} }
bail: bail:
if (menu) if (menu)
{ {
......
...@@ -462,7 +462,7 @@ static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, ...@@ -462,7 +462,7 @@ static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data,
return (-1); return (-1);
} }
if( if (
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
/* we're running without curses */ /* we're running without curses */
option (OPTNOCURSES) option (OPTNOCURSES)
......
...@@ -223,7 +223,8 @@ int mutt_display_message (HEADER *cur) ...@@ -223,7 +223,8 @@ int mutt_display_message (HEADER *cur)
} }
res = mutt_copy_message (fpout, Context, cur, cmflags, res = mutt_copy_message (fpout, Context, cur, cmflags,
(option (OPTWEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM | CH_DISPLAY); (option (OPTWEED) ? (CH_WEED | CH_REORDER) : 0) |
CH_DECODE | CH_FROM | CH_DISPLAY);
if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res < 0) if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res < 0)
{ {
mutt_error (_("Could not copy message")); mutt_error (_("Could not copy message"));
......
...@@ -79,7 +79,9 @@ int mutt_complete (char *s, size_t slen) ...@@ -79,7 +79,9 @@ int mutt_complete (char *s, size_t slen)
if ((p = strrchr (s, '/'))) if ((p = strrchr (s, '/')))
{ {
char buf[_POSIX_PATH_MAX]; char buf[_POSIX_PATH_MAX];
if (mutt_concatn_path (buf, sizeof(buf), exp_dirpart, strlen(exp_dirpart), s + 1, (size_t)(p - s - 1)) == NULL) { if (mutt_concatn_path (buf, sizeof(buf), exp_dirpart, strlen(exp_dirpart),
s + 1, (size_t)(p - s - 1)) == NULL)
{
return -1; return -1;
} }
strfcpy (exp_dirpart, buf, sizeof (exp_dirpart)); strfcpy (exp_dirpart, buf, sizeof (exp_dirpart));
......
...@@ -1207,8 +1207,8 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */ ...@@ -1207,8 +1207,8 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
CHECK_COUNT; CHECK_COUNT;
strfcpy (fname, CURATTACH->content->filename, sizeof (fname)); strfcpy (fname, CURATTACH->content->filename, sizeof (fname));
mutt_pretty_mailbox (fname, sizeof (fname)); mutt_pretty_mailbox (fname, sizeof (fname));
if (mutt_get_field (_("Rename to: "), fname, sizeof (fname), MUTT_FILE) if ((mutt_get_field (_("Rename to: "), fname, sizeof (fname), MUTT_FILE) == 0)
== 0 && fname[0]) && fname[0])
{ {
if (stat(CURATTACH->content->filename, &st) == -1) if (stat(CURATTACH->content->filename, &st) == -1)
{ {
......
...@@ -325,7 +325,7 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, ...@@ -325,7 +325,7 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags,
return (0); return (0);
} }
/* flags /* flags:
CH_DECODE RFC2047 header decoding CH_DECODE RFC2047 header decoding
CH_FROM retain the "From " message separator CH_FROM retain the "From " message separator
CH_FORCE_FROM give CH_FROM precedence over CH_WEED CH_FORCE_FROM give CH_FROM precedence over CH_WEED
...@@ -345,9 +345,9 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, ...@@ -345,9 +345,9 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags,
CH_UPDATE_REFS update the References: header CH_UPDATE_REFS update the References: header
CH_UPDATE_LABEL update the X-Label: header CH_UPDATE_LABEL update the X-Label: header
prefix prefix:
string to use if CH_PREFIX is set string to use if CH_PREFIX is set
*/ */
int int
mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix) mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* /*
This is a crytpo module wrapping the classic pgp code. This is a crytpo module wrapping the classic pgp code.
*/ */
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
# include "config.h" # include "config.h"
...@@ -107,7 +107,7 @@ static void crypt_mod_pgp_extract_keys_from_attachment_list (FILE *fp, int tag, ...@@ -107,7 +107,7 @@ static void crypt_mod_pgp_extract_keys_from_attachment_list (FILE *fp, int tag,
} }
struct crypt_module_specs crypt_mod_pgp_classic = struct crypt_module_specs crypt_mod_pgp_classic =
{ APPLICATION_PGP, { APPLICATION_PGP,
{ {
NULL, /* init */ NULL, /* init */
crypt_mod_pgp_void_passphrase, crypt_mod_pgp_void_passphrase,
...@@ -134,4 +134,4 @@ struct crypt_module_specs crypt_mod_pgp_classic = ...@@ -134,4 +134,4 @@ struct crypt_module_specs crypt_mod_pgp_classic =
NULL, /* smime_build_smime_entity */ NULL, /* smime_build_smime_entity */
NULL, /* smime_invoke_import */ NULL, /* smime_invoke_import */
} }
}; };
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* /*
This is a crytpo module wrapping the gpgme based pgp code. This is a crytpo module wrapping the gpgme based pgp code.
*/ */
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
# include "config.h" # include "config.h"
...@@ -106,7 +106,7 @@ static void crypt_mod_pgp_set_sender (const char *sender) ...@@ -106,7 +106,7 @@ static void crypt_mod_pgp_set_sender (const char *sender)
} }
struct crypt_module_specs crypt_mod_pgp_gpgme = struct crypt_module_specs crypt_mod_pgp_gpgme =
{ APPLICATION_PGP, { APPLICATION_PGP,
{ {
/* Common. */ /* Common. */
crypt_mod_pgp_init, crypt_mod_pgp_init,
...@@ -135,6 +135,6 @@ struct crypt_module_specs crypt_mod_pgp_gpgme = ...@@ -135,6 +135,6 @@ struct crypt_module_specs crypt_mod_pgp_gpgme =
NULL, /* smime_build_smime_entity */ NULL, /* smime_build_smime_entity */
NULL, /* smime_invoke_import */ NULL, /* smime_invoke_import */
} }
}; };
#endif #endif
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* /*
This is a crytpo module wrapping the classic smime code. This is a crytpo module wrapping the classic smime code.
*/ */
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
# include "config.h" # include "config.h"
...@@ -88,7 +88,7 @@ static void crypt_mod_smime_invoke_import (char *infile, char *mailbox) ...@@ -88,7 +88,7 @@ static void crypt_mod_smime_invoke_import (char *infile, char *mailbox)
struct crypt_module_specs crypt_mod_smime_classic = struct crypt_module_specs crypt_mod_smime_classic =
{ APPLICATION_SMIME, { APPLICATION_SMIME,
{ {
NULL, /* init */ NULL, /* init */
crypt_mod_smime_void_passphrase, crypt_mod_smime_void_passphrase,
...@@ -115,4 +115,4 @@ struct crypt_module_specs crypt_mod_smime_classic = ...@@ -115,4 +115,4 @@ struct crypt_module_specs crypt_mod_smime_classic =
crypt_mod_smime_build_smime_entity, crypt_mod_smime_build_smime_entity,
crypt_mod_smime_invoke_import, crypt_mod_smime_invoke_import,
} }
}; };
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* /*
This is a crytpo module wrapping the gpgme based smime code. This is a crytpo module wrapping the gpgme based smime code.
*/ */
#if HAVE_CONFIG_H #if HAVE_CONFIG_H
# include "config.h" # include "config.h"
...@@ -86,7 +86,7 @@ static int crypt_mod_smime_verify_sender (HEADER *h) ...@@ -86,7 +86,7 @@ static int crypt_mod_smime_verify_sender (HEADER *h)
} }
struct crypt_module_specs crypt_mod_smime_gpgme = struct crypt_module_specs crypt_mod_smime_gpgme =
{ APPLICATION_SMIME, { APPLICATION_SMIME,
{ {
crypt_mod_smime_init, crypt_mod_smime_init,
crypt_mod_smime_void_passphrase, crypt_mod_smime_void_passphrase,
...@@ -113,6 +113,6 @@ struct crypt_module_specs crypt_mod_smime_gpgme = ...@@ -113,6 +113,6 @@ struct crypt_module_specs crypt_mod_smime_gpgme =
crypt_mod_smime_build_smime_entity, crypt_mod_smime_build_smime_entity,
NULL, /* smime_invoke_import */ NULL, /* smime_invoke_import */
} }
}; };
#endif #endif
...@@ -743,8 +743,7 @@ void crypt_extract_keys_from_messages (HEADER * h) ...@@ -743,8 +743,7 @@ void crypt_extract_keys_from_messages (HEADER * h)
if (Context->hdrs[Context->v2r[i]]->env->from) if (Context->hdrs[Context->v2r[i]]->env->from)
tmp = mutt_expand_aliases (Context->hdrs[Context->v2r[i]]->env->from); tmp = mutt_expand_aliases (Context->hdrs[Context->v2r[i]]->env->from);
else if (Context->hdrs[Context->v2r[i]]->env->sender) else if (Context->hdrs[Context->v2r[i]]->env->sender)
tmp = mutt_expand_aliases (Context->hdrs[Context->v2r[i]] tmp = mutt_expand_aliases (Context->hdrs[Context->v2r[i]]->env->sender);
->env->sender);
mbox = tmp ? tmp->mailbox : NULL; mbox = tmp ? tmp->mailbox : NULL;
if (mbox) if (mbox)
{ {
...@@ -776,9 +775,9 @@ void crypt_extract_keys_from_messages (HEADER * h) ...@@ -776,9 +775,9 @@ void crypt_extract_keys_from_messages (HEADER * h)
&& (h->security & APPLICATION_SMIME)) && (h->security & APPLICATION_SMIME))
{ {
if (h->security & ENCRYPT) if (h->security & ENCRYPT)
mutt_copy_message (fpout, Context, h, MUTT_CM_NOHEADER mutt_copy_message (fpout, Context, h,
|MUTT_CM_DECODE_CRYPT MUTT_CM_NOHEADER | MUTT_CM_DECODE_CRYPT | MUTT_CM_DECODE_SMIME,
|MUTT_CM_DECODE_SMIME, 0); 0);
else else
mutt_copy_message (fpout, Context, h, 0, 0); mutt_copy_message (fpout, Context, h, 0, 0);
......
...@@ -64,14 +64,16 @@ static const char *Mailbox_is_read_only = N_("Mailbox is read-only."); ...@@ -64,14 +64,16 @@ static const char *Mailbox_is_read_only = N_("Mailbox is read-only.");
static const char *Function_not_permitted_in_attach_message_mode = N_("Function not permitted in attach-message mode."); static const char *Function_not_permitted_in_attach_message_mode = N_("Function not permitted in attach-message mode.");
static const char *No_visible = N_("No visible messages."); static const char *No_visible = N_("No visible messages.");
#define CHECK_IN_MAILBOX if (!Context) \ #define CHECK_IN_MAILBOX \
if (!Context) \
{ \ { \
mutt_flushinp (); \ mutt_flushinp (); \
mutt_error _(No_mailbox_is_open); \ mutt_error _(No_mailbox_is_open); \
break; \ break; \
} }
#define CHECK_MSGCOUNT if (!Context) \ #define CHECK_MSGCOUNT \
if (!Context) \
{ \ { \
mutt_flushinp (); \ mutt_flushinp (); \
mutt_error _(No_mailbox_is_open); \ mutt_error _(No_mailbox_is_open); \
...@@ -84,15 +86,17 @@ static const char *No_visible = N_("No visible messages."); ...@@ -84,15 +86,17 @@ static const char *No_visible = N_("No visible messages.");
break; \ break; \
} }
#define CHECK_VISIBLE if (Context && menu->current >= Context->vcount) \ #define CHECK_VISIBLE \
{\ if (Context && menu->current >= Context->vcount) \
{ \
mutt_flushinp (); \ mutt_flushinp (); \
mutt_error _(No_visible); \ mutt_error _(No_visible); \
break; \ break; \
} }
#define CHECK_READONLY if (Context->readonly) \ #define CHECK_READONLY \
if (Context->readonly) \
{ \ { \
mutt_flushinp (); \ mutt_flushinp (); \
mutt_error _(Mailbox_is_read_only); \ mutt_error _(Mailbox_is_read_only); \
...@@ -100,15 +104,17 @@ static const char *No_visible = N_("No visible messages."); ...@@ -100,15 +104,17 @@ static const char *No_visible = N_("No visible messages.");
} }
#define CHECK_ACL(aclbit,action) \ #define CHECK_ACL(aclbit,action) \
if (!mutt_bit_isset(Context->rights,aclbit)) { \ if (!mutt_bit_isset(Context->rights,aclbit)) \
{ \
mutt_flushinp(); \ mutt_flushinp(); \
/* L10N: %s is one of the CHECK_ACL entries below. */ \ /* L10N: %s is one of the CHECK_ACL entries below. */ \
mutt_error (_("%s: Operation not permitted by ACL"), action); \ mutt_error (_("%s: Operation not permitted by ACL"), action); \
break; \ break; \
} }
#define CHECK_ATTACH if(option(OPTATTACHMSG)) \ #define CHECK_ATTACH \
{\ if (option(OPTATTACHMSG)) \
{ \
mutt_flushinp (); \ mutt_flushinp (); \
mutt_error _(Function_not_permitted_in_attach_message_mode); \ mutt_error _(Function_not_permitted_in_attach_message_mode); \
break; \ break; \
......
...@@ -368,8 +368,8 @@ struct ...@@ -368,8 +368,8 @@ struct
char *machine; char *machine;
char *human; char *human;
} }
types[] = types[] =
{ {
{ "DT_NONE", "-none-" }, { "DT_NONE", "-none-" },
{ "DT_BOOL", "boolean" }, { "DT_BOOL", "boolean" },
{ "DT_NUM", "number" }, { "DT_NUM", "number" },
...@@ -384,7 +384,7 @@ types[] = ...@@ -384,7 +384,7 @@ types[] =
{ "DT_ADDR", "e-mail address" }, { "DT_ADDR", "e-mail address" },
{ "DT_MBCHARTBL", "string" }, { "DT_MBCHARTBL", "string" },
{ NULL, NULL } { NULL, NULL }
}; };
static int buff2type (const char *s) static int buff2type (const char *s)
......
...@@ -191,7 +191,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) ...@@ -191,7 +191,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur)
mx_close_mailbox (&tmpctx, NULL); mx_close_mailbox (&tmpctx, NULL);
bail: bail:
if (fp) safe_fclose (&fp); if (fp) safe_fclose (&fp);
if (rc >= 0) if (rc >= 0)
......
...@@ -579,8 +579,9 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, ...@@ -579,8 +579,9 @@ int _mutt_enter_string (char *buf, size_t buflen, int col,
else if (flags & MUTT_ALIAS && ch == OP_EDITOR_COMPLETE) else if (flags & MUTT_ALIAS && ch == OP_EDITOR_COMPLETE)
{ {
/* invoke the alias-menu to get more addresses */ /* invoke the alias-menu to get more addresses */
for (i = state->curpos; i && state->wbuf[i-1] != ',' && for (i = state->curpos;
state->wbuf[i-1] != ':'; i--) i && state->wbuf[i-1] != ',' && state->wbuf[i-1] != ':';
i--)
; ;
for (; i < state->lastchar && state->wbuf[i] == ' '; i++) for (; i < state->lastchar && state->wbuf[i] == ' '; i++)
; ;
...@@ -596,8 +597,9 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, ...@@ -596,8 +597,9 @@ int _mutt_enter_string (char *buf, size_t buflen, int col,
} }
else if (flags & MUTT_LABEL && ch == OP_EDITOR_COMPLETE) else if (flags & MUTT_LABEL && ch == OP_EDITOR_COMPLETE)
{ {
for (i = state->curpos; i && state->wbuf[i-1] != ',' && for (i = state->curpos;
state->wbuf[i-1] != ':'; i--) i && state->wbuf[i-1] != ',' && state->wbuf[i-1] != ':';
i--)
; ;
for (; i < state->lastchar && state->wbuf[i] == ' '; i++) for (; i < state->lastchar && state->wbuf[i] == ' '; i++)
; ;
...@@ -665,7 +667,8 @@ int _mutt_enter_string (char *buf, size_t buflen, int col, ...@@ -665,7 +667,8 @@ int _mutt_enter_string (char *buf, size_t buflen, int col,
my_wcstombs (buf, buflen, state->wbuf, state->curpos); my_wcstombs (buf, buflen, state->wbuf, state->curpos);
/* see if the path has changed from the last time */ /* see if the path has changed from the last time */
if ((!tempbuf && !state->lastchar) || (tempbuf && templen == state->lastchar && if ((!tempbuf && !state->lastchar) ||
(tempbuf && templen == state->lastchar &&
!memcmp (tempbuf, state->wbuf, state->lastchar * sizeof (wchar_t)))) !memcmp (tempbuf, state->wbuf, state->lastchar * sizeof (wchar_t))))
{ {
_mutt_select_file (buf, buflen, _mutt_select_file (buf, buflen,
...@@ -816,7 +819,7 @@ self_insert: ...@@ -816,7 +819,7 @@ self_insert:
} }
} }
bye: bye:
mutt_reset_history_state (hclass); mutt_reset_history_state (hclass);
FREE (&tempbuf); FREE (&tempbuf);
......
...@@ -1015,7 +1015,8 @@ static int alternative_handler (BODY *a, STATE *s) ...@@ -1015,7 +1015,8 @@ static int alternative_handler (BODY *a, STATE *s)
b->length = (long) st.st_size; b->length = (long) st.st_size;
b->parts = mutt_parse_multipart (s->fpin, b->parts = mutt_parse_multipart (s->fpin,
mutt_get_parameter ("boundary", a->parameter), mutt_get_parameter ("boundary", a->parameter),
(long) st.st_size, ascii_strcasecmp ("digest", a->subtype) == 0); (long) st.st_size,
ascii_strcasecmp ("digest", a->subtype) == 0);
} }
else else
b = a; b = a;
...@@ -1241,7 +1242,8 @@ static int multipart_handler (BODY *a, STATE *s) ...@@ -1241,7 +1242,8 @@ static int multipart_handler (BODY *a, STATE *s)
b->length = (long) st.st_size; b->length = (long) st.st_size;
b->parts = mutt_parse_multipart (s->fpin, b->parts = mutt_parse_multipart (s->fpin,
mutt_get_parameter ("boundary", a->parameter), mutt_get_parameter ("boundary", a->parameter),
(long) st.st_size, ascii_strcasecmp ("digest", a->subtype) == 0); (long) st.st_size,
ascii_strcasecmp ("digest", a->subtype) == 0);
} }
else else
b = a; b = a;
......
...@@ -1288,13 +1288,13 @@ hcache_open_db4 (struct header_cache* h, const char* path) ...@@ -1288,13 +1288,13 @@ hcache_open_db4 (struct header_cache* h, const char* path)
return 0; return 0;
fail_db: fail_db:
h->db->close (h->db, 0); h->db->close (h->db, 0);
fail_env: fail_env:
h->env->close (h->env, 0); h->env->close (h->env, 0);
fail_unlock: fail_unlock:
mx_unlock_file (h->lockfile, h->fd, 0); mx_unlock_file (h->lockfile, h->fd, 0);
fail_close: fail_close:
close (h->fd); close (h->fd);
unlink (h->lockfile); unlink (h->lockfile);
......
...@@ -465,7 +465,9 @@ hdr_format_str (char *dest, ...@@ -465,7 +465,9 @@ hdr_format_str (char *dest,
case 'H': case 'H':
/* (Hormel) spam score */ /* (Hormel) spam score */
if (optional) if (optional)
{
optional = hdr->env->spam ? 1 : 0; optional = hdr->env->spam ? 1 : 0;
}
if (hdr->env->spam) if (hdr->env->spam)
mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->spam->data)); mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->spam->data));
......
...@@ -604,8 +604,8 @@ static char *_mutt_string_hook (const char *match, int hook) ...@@ -604,8 +604,8 @@ static char *_mutt_string_hook (const char *match, int hook)
for (; tmp; tmp = tmp->next) for (; tmp; tmp = tmp->next)
{ {
if ((tmp->type & hook) && ((match && if ((tmp->type & hook) &&
regexec (tmp->rx.rx, match, 0, NULL, 0) == 0) ^ tmp->rx.not)) ((match && regexec (tmp->rx.rx, match, 0, NULL, 0) == 0) ^ tmp->rx.not))
return (tmp->command); return (tmp->command);
} }
return (NULL); return (NULL);
......
...@@ -69,7 +69,7 @@ imap_auth_res_t imap_auth_anon (IMAP_DATA* idata, const char* method) ...@@ -69,7 +69,7 @@ imap_auth_res_t imap_auth_anon (IMAP_DATA* idata, const char* method)
if (imap_code (idata->buf)) if (imap_code (idata->buf))
return IMAP_AUTH_SUCCESS; return IMAP_AUTH_SUCCESS;
bail: