diff options
author | Kevin McCarthy <kevin@8t8.us> | 2019-01-03 19:58:18 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2019-01-04 13:59:27 -0800 |
commit | 248c2ee8ed7c0ff333ae076041107210c5acd641 (patch) | |
tree | f51f10f1f486e08c76e187c095e536620bebbbd0 /attach.c | |
parent | 085a6f74b3b7cebabb75f4c99ea9d59649c7b03a (diff) |
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.
Diffstat (limited to 'attach.c')
-rw-r--r-- | attach.c | 66 |
1 files changed, 34 insertions, 32 deletions
@@ -202,7 +202,7 @@ int mutt_compose_attachment (BODY *a) else { mutt_message (_("No mailcap compose entry for %s, creating empty file."), - type); + type); rc = 1; goto bailout; } @@ -295,7 +295,7 @@ int mutt_edit_attachment (BODY *a) rc = 1; - bailout: +bailout: if(unlink_newfile) unlink(mutt_b2s (newfile)); @@ -313,32 +313,34 @@ void mutt_check_lookup_list (BODY *b, char *type, int len) LIST *t = MimeLookupList; int i; - for (; t; t = t->next) { + for (; t; t = t->next) + { i = mutt_strlen (t->data) - 1; if ((i > 0 && t->data[i-1] == '/' && t->data[i] == '*' && ascii_strncasecmp (type, t->data, i) == 0) || - ascii_strcasecmp (type, t->data) == 0) { - - BODY tmp = {0}; - int n; - if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) { - snprintf (type, len, "%s/%s", - n == TYPEAUDIO ? "audio" : - n == TYPEAPPLICATION ? "application" : - n == TYPEIMAGE ? "image" : - n == TYPEMESSAGE ? "message" : - n == TYPEMODEL ? "model" : - n == TYPEMULTIPART ? "multipart" : - n == TYPETEXT ? "text" : - n == TYPEVIDEO ? "video" : "other", - tmp.subtype); - dprint(1, (debugfile, "mutt_check_lookup_list: \"%s\" -> %s\n", - b->filename, type)); - } - if (tmp.subtype) - FREE (&tmp.subtype); - if (tmp.xtype) - FREE (&tmp.xtype); + ascii_strcasecmp (type, t->data) == 0) + { + BODY tmp = {0}; + int n; + if ((n = mutt_lookup_mime_type (&tmp, b->filename)) != TYPEOTHER) + { + snprintf (type, len, "%s/%s", + n == TYPEAUDIO ? "audio" : + n == TYPEAPPLICATION ? "application" : + n == TYPEIMAGE ? "image" : + n == TYPEMESSAGE ? "message" : + n == TYPEMODEL ? "model" : + n == TYPEMULTIPART ? "multipart" : + n == TYPETEXT ? "text" : + n == TYPEVIDEO ? "video" : "other", + tmp.subtype); + dprint(1, (debugfile, "mutt_check_lookup_list: \"%s\" -> %s\n", + b->filename, type)); + } + if (tmp.subtype) + FREE (&tmp.subtype); + if (tmp.xtype) + FREE (&tmp.xtype); } } } @@ -371,7 +373,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, command = mutt_buffer_pool_get (); use_mailcap = (flag == MUTT_MAILCAP || - (flag == MUTT_REGULAR && mutt_needs_mailcap (a))); + (flag == MUTT_REGULAR && mutt_needs_mailcap (a))); snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype); if (use_mailcap) @@ -582,7 +584,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, strfcpy (descrip, a->description, sizeof (descrip)); else if (a->filename) snprintf (descrip, sizeof (descrip), _("---Attachment: %s: %s"), - a->filename, type); + a->filename, type); else snprintf (descrip, sizeof (descrip), _("---Attachment: %s"), type); } @@ -607,7 +609,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, else rc = 0; - return_error: +return_error: if (entry) rfc1524_free_entry (&entry); @@ -739,10 +741,10 @@ int mutt_save_attachment (FILE *fp, BODY *m, const char *path, int flags, HEADER /* recv mode */ if(hdr && - m->hdr && - m->encoding != ENCBASE64 && - m->encoding != ENCQUOTEDPRINTABLE && - mutt_is_message_type(m->type, m->subtype)) + m->hdr && + m->encoding != ENCBASE64 && + m->encoding != ENCQUOTEDPRINTABLE && + mutt_is_message_type(m->type, m->subtype)) { /* message type attachments are written to mail folders. */ |