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 passed with stages
in 2 minutes and 59 seconds
...@@ -280,7 +280,7 @@ char* mutt_account_getoauthbearer (ACCOUNT* account) ...@@ -280,7 +280,7 @@ char* mutt_account_getoauthbearer (ACCOUNT* account)
one of your $*_authenticators and (2) you do not have the corresponding one of your $*_authenticators and (2) you do not have the corresponding
$*_oauth_refresh_command defined. So the message does not mean "None of $*_oauth_refresh_command defined. So the message does not mean "None of
your $*_oauth_refresh_command's are defined." your $*_oauth_refresh_command's are defined."
*/ */
mutt_error (_("mutt_account_getoauthbearer: No OAUTH refresh command defined")); mutt_error (_("mutt_account_getoauthbearer: No OAUTH refresh command defined"));
return NULL; return NULL;
} }
...@@ -310,8 +310,8 @@ char* mutt_account_getoauthbearer (ACCOUNT* account) ...@@ -310,8 +310,8 @@ char* mutt_account_getoauthbearer (ACCOUNT* account)
oauthbearer = safe_malloc (oalen); oauthbearer = safe_malloc (oalen);
snprintf (oauthbearer, oalen, snprintf (oauthbearer, oalen,
"n,a=%s,\001host=%s\001port=%d\001auth=Bearer %s\001\001", "n,a=%s,\001host=%s\001port=%d\001auth=Bearer %s\001\001",
account->login, account->host, account->port, token); account->login, account->host, account->port, token);
FREE (&token); FREE (&token);
......
...@@ -177,7 +177,7 @@ new_aliases: ...@@ -177,7 +177,7 @@ new_aliases:
if ((SortAlias & SORT_MASK) != SORT_ORDER) if ((SortAlias & SORT_MASK) != SORT_ORDER)
{ {
qsort (AliasTable, i, sizeof (ALIAS *), qsort (AliasTable, i, sizeof (ALIAS *),
(SortAlias & SORT_MASK) == SORT_ADDRESS ? alias_SortAddress : alias_SortAlias); (SortAlias & SORT_MASK) == SORT_ADDRESS ? alias_SortAddress : alias_SortAlias);
} }
for (i=0; i<menu->max; i++) AliasTable[i]->num = i; for (i=0; i<menu->max; i++) AliasTable[i]->num = i;
......
...@@ -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;
...@@ -411,7 +411,7 @@ int mutt_check_alias_name (const char *s, char *dest, size_t destlen) ...@@ -411,7 +411,7 @@ int mutt_check_alias_name (const char *s, char *dest, size_t destlen)
if (!dry) if (!dry)
destlen--; destlen--;
for (; s && *s && (dry || destlen) && for (; s && *s && (dry || destlen) &&
(l = mbrtowc (&wc, s, MB_CUR_MAX, &mb)) != 0; (l = mbrtowc (&wc, s, MB_CUR_MAX, &mb)) != 0;
s += l, destlen -= l) s += l, destlen -= l)
{ {
bad = l == (size_t)(-1) || l == (size_t)(-2); /* conversion error */ bad = l == (size_t)(-1) || l == (size_t)(-2); /* conversion error */
...@@ -447,7 +447,7 @@ int mutt_check_alias_name (const char *s, char *dest, size_t destlen) ...@@ -447,7 +447,7 @@ int mutt_check_alias_name (const char *s, char *dest, size_t destlen)
ADDRESS *alias_reverse_lookup (ADDRESS *a) ADDRESS *alias_reverse_lookup (ADDRESS *a)
{ {
if (!a || !a->mailbox) if (!a || !a->mailbox)
return NULL; return NULL;
return hash_find (ReverseAlias, a->mailbox); return hash_find (ReverseAlias, a->mailbox);
} }
......
...@@ -202,7 +202,7 @@ int mutt_compose_attachment (BODY *a) ...@@ -202,7 +202,7 @@ int mutt_compose_attachment (BODY *a)
else else
{ {
mutt_message (_("No mailcap compose entry for %s, creating empty file."), mutt_message (_("No mailcap compose entry for %s, creating empty file."),
type); type);
rc = 1; rc = 1;
goto bailout; goto bailout;
} }
...@@ -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,32 +313,34 @@ void mutt_check_lookup_list (BODY *b, char *type, int len) ...@@ -313,32 +313,34 @@ 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", {
n == TYPEAUDIO ? "audio" : snprintf (type, len, "%s/%s",
n == TYPEAPPLICATION ? "application" : n == TYPEAUDIO ? "audio" :
n == TYPEIMAGE ? "image" : n == TYPEAPPLICATION ? "application" :
n == TYPEMESSAGE ? "message" : n == TYPEIMAGE ? "image" :
n == TYPEMODEL ? "model" : n == TYPEMESSAGE ? "message" :
n == TYPEMULTIPART ? "multipart" : n == TYPEMODEL ? "model" :
n == TYPETEXT ? "text" : n == TYPEMULTIPART ? "multipart" :
n == TYPEVIDEO ? "video" : "other", n == TYPETEXT ? "text" :
tmp.subtype); n == TYPEVIDEO ? "video" : "other",
dprint(1, (debugfile, "mutt_check_lookup_list: \"%s\" -> %s\n", tmp.subtype);
b->filename, type)); dprint(1, (debugfile, "mutt_check_lookup_list: \"%s\" -> %s\n",
} b->filename, type));
if (tmp.subtype) }
FREE (&tmp.subtype); if (tmp.subtype)
if (tmp.xtype) FREE (&tmp.subtype);
FREE (&tmp.xtype); if (tmp.xtype)
FREE (&tmp.xtype);
} }
} }
} }
...@@ -371,7 +373,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, ...@@ -371,7 +373,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
command = mutt_buffer_pool_get (); command = mutt_buffer_pool_get ();
use_mailcap = (flag == MUTT_MAILCAP || 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); snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (use_mailcap) if (use_mailcap)
...@@ -582,7 +584,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, ...@@ -582,7 +584,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
strfcpy (descrip, a->description, sizeof (descrip)); strfcpy (descrip, a->description, sizeof (descrip));
else if (a->filename) else if (a->filename)
snprintf (descrip, sizeof (descrip), _("---Attachment: %s: %s"), snprintf (descrip, sizeof (descrip), _("---Attachment: %s: %s"),
a->filename, type); a->filename, type);
else else
snprintf (descrip, sizeof (descrip), _("---Attachment: %s"), type); snprintf (descrip, sizeof (descrip), _("---Attachment: %s"), type);
} }
...@@ -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);
...@@ -739,10 +741,10 @@ int mutt_save_attachment (FILE *fp, BODY *m, const char *path, int flags, HEADER ...@@ -739,10 +741,10 @@ int mutt_save_attachment (FILE *fp, BODY *m, const char *path, int flags, HEADER
/* recv mode */ /* recv mode */
if(hdr && if(hdr &&
m->hdr && m->hdr &&
m->encoding != ENCBASE64 && m->encoding != ENCBASE64 &&
m->encoding != ENCQUOTEDPRINTABLE && m->encoding != ENCQUOTEDPRINTABLE &&
mutt_is_message_type(m->type, m->subtype)) mutt_is_message_type(m->type, m->subtype))
{ {
/* message type attachments are written to mail folders. */ /* message type attachments are written to mail folders. */
......
...@@ -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;
......
This diff is collapsed.
...@@ -55,9 +55,9 @@ void mutt_buffer_free (BUFFER **p) ...@@ -55,9 +55,9 @@ void mutt_buffer_free (BUFFER **p)
if (!p || !*p) if (!p || !*p)
return; return;
FREE (&(*p)->data); FREE (&(*p)->data);
/* dptr is just an offset to data and shouldn't be freed */ /* dptr is just an offset to data and shouldn't be freed */
FREE (p); /* __FREE_CHECKED__ */ FREE (p); /* __FREE_CHECKED__ */
} }
void mutt_buffer_clear (BUFFER *b) void mutt_buffer_clear (BUFFER *b)
......
...@@ -586,16 +586,16 @@ int mutt_buffy_check (int force) ...@@ -586,16 +586,16 @@ int mutt_buffy_check (int force)
tmp->magic = MUTT_POP; tmp->magic = MUTT_POP;
else else
#endif #endif
if (stat (tmp->path, &sb) != 0 || (S_ISREG(sb.st_mode) && sb.st_size == 0) || if (stat (tmp->path, &sb) != 0 || (S_ISREG(sb.st_mode) && sb.st_size == 0) ||
(!tmp->magic && (tmp->magic = mx_get_magic (tmp->path)) <= 0)) (!tmp->magic && (tmp->magic = mx_get_magic (tmp->path)) <= 0))
{ {
/* if the mailbox still doesn't exist, set the newly created flag to /* if the mailbox still doesn't exist, set the newly created flag to
* be ready for when it does. */ * be ready for when it does. */
tmp->newly_created = 1; tmp->newly_created = 1;
tmp->magic = 0; tmp->magic = 0;
tmp->size = 0; tmp->size = 0;
continue; continue;
} }
} }
/* check to see if the folder is the currently selected folder /* check to see if the folder is the currently selected folder
......
...@@ -269,8 +269,8 @@ int mutt_alloc_color (int fg, int bg) ...@@ -269,8 +269,8 @@ int mutt_alloc_color (int fg, int bg)
SLtt_set_color (i, NULL, get_color_name (fgc, sizeof (fgc), fg), get_color_name (bgc, sizeof (bgc), bg)); SLtt_set_color (i, NULL, get_color_name (fgc, sizeof (fgc), fg), get_color_name (bgc, sizeof (bgc), bg));
else else
#elif defined (HAVE_USE_DEFAULT_COLORS) #elif defined (HAVE_USE_DEFAULT_COLORS)
if (fg == COLOR_DEFAULT) if (fg == COLOR_DEFAULT)
fg = -1; fg = -1;
if (bg == COLOR_DEFAULT) if (bg == COLOR_DEFAULT)
bg = -1; bg = -1;
#endif #endif
...@@ -297,7 +297,7 @@ void mutt_free_color (int fg, int bg) ...@@ -297,7 +297,7 @@ void mutt_free_color (int fg, int bg)
UserColors--; UserColors--;
dprint(1,(debugfile,"mutt_free_color(): Color pairs used so far: %d\n", dprint(1,(debugfile,"mutt_free_color(): Color pairs used so far: %d\n",
UserColors)); UserColors));
if (p == ColorList) if (p == ColorList)
{ {
...@@ -404,7 +404,7 @@ parse_color_name (const char *s, int *col, int *attr, int is_fg, BUFFER *err) ...@@ -404,7 +404,7 @@ parse_color_name (const char *s, int *col, int *attr, int is_fg, BUFFER *err)
static int static int
_mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err, _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err,
short parse_uncolor); short parse_uncolor);
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
...@@ -462,19 +462,19 @@ static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, ...@@ -462,19 +462,19 @@ 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)
|| /* we're parsing an uncolor command, and have no colors */ || /* we're parsing an uncolor command, and have no colors */
(parse_uncolor && !has_colors()) (parse_uncolor && !has_colors())
/* we're parsing an unmono command, and have colors */ /* we're parsing an unmono command, and have colors */
|| (!parse_uncolor && has_colors()) || (!parse_uncolor && has_colors())
#else #else
/* We don't even have colors compiled in */ /* We don't even have colors compiled in */
parse_uncolor parse_uncolor
#endif #endif
) )
{ {
/* just eat the command, but don't do anything real about it */ /* just eat the command, but don't do anything real about it */
do do
...@@ -508,7 +508,7 @@ static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, ...@@ -508,7 +508,7 @@ static int _mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data,
if (!do_cache) if (!do_cache)
do_cache = 1; do_cache = 1;
dprint(1,(debugfile,"Freeing pattern \"%s\" from color list\n", dprint(1,(debugfile,"Freeing pattern \"%s\" from color list\n",
tmp->pattern)); tmp->pattern));
if (last) if (last)
last->next = tmp->next; last->next = tmp->next;
else else
...@@ -805,9 +805,9 @@ _mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err, ...@@ -805,9 +805,9 @@ _mutt_parse_color (BUFFER *buf, BUFFER *s, BUFFER *err,
#ifdef HAVE_COLOR #ifdef HAVE_COLOR
# ifdef HAVE_USE_DEFAULT_COLORS # ifdef HAVE_USE_DEFAULT_COLORS
if (!option (OPTNOCURSES) && has_colors() if (!option (OPTNOCURSES) && has_colors()
/* delay use_default_colors() until needed, since it initializes things */ /* delay use_default_colors() until needed, since it initializes things */
&& (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT) && (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT)
&& use_default_colors () != OK) && use_default_colors () != OK)
{ {
strfcpy (err->data, _("default colors not supported"), err->dsize); strfcpy (err->data, _("default colors not supported"), err->dsize);
return (-1); return (-1);
......
...@@ -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"));
...@@ -326,8 +327,8 @@ void ci_bounce_message (HEADER *h) ...@@ -326,8 +327,8 @@ void ci_bounce_message (HEADER *h)
char *err = NULL; char *err = NULL;
int rc; int rc;
/* RfC 5322 mandates a From: header, so warn before bouncing /* RfC 5322 mandates a From: header, so warn before bouncing
* messages without one */ * messages without one */
if (h) if (h)
{ {
if (!h->env->from) if (!h->env->from)
...@@ -379,7 +380,7 @@ void ci_bounce_message (HEADER *h) ...@@ -379,7 +380,7 @@ void ci_bounce_message (HEADER *h)
#define extra_space (15 + 7 + 2) #define extra_space (15 + 7 + 2)
snprintf (scratch, sizeof (scratch), snprintf (scratch, sizeof (scratch),
(h ? _("Bounce message to %s") : _("Bounce messages to %s")), buf); (h ? _("Bounce message to %s") : _("Bounce messages to %s")), buf);
if (mutt_strwidth (prompt) > MuttMessageWindow->cols - extra_space) if (mutt_strwidth (prompt) > MuttMessageWindow->cols - extra_space)
{ {
...@@ -591,7 +592,7 @@ void mutt_print_message (HEADER *h) ...@@ -591,7 +592,7 @@ void mutt_print_message (HEADER *h)
if (query_quadoption (OPT_PRINT, if (query_quadoption (OPT_PRINT,
h ? _("Print message?") : _("Print tagged messages?")) h ? _("Print message?") : _("Print tagged messages?"))
!= MUTT_YES) != MUTT_YES)
return; return;
if (_mutt_pipe_message (h, PrintCmd, if (_mutt_pipe_message (h, PrintCmd,
...@@ -620,52 +621,52 @@ int mutt_select_sort (int reverse) ...@@ -620,52 +621,52 @@ int mutt_select_sort (int reverse)
_("Sort Date/Frm/Recv/Subj/tO/Thread/Unsort/siZe/sCore/sPam/Label?: "), _("Sort Date/Frm/Recv/Subj/tO/Thread/Unsort/siZe/sCore/sPam/Label?: "),
_("dfrsotuzcpl"))) _("dfrsotuzcpl")))
{ {
case -1: /* abort - don't resort */ case -1: /* abort - don't resort */
return -1; return -1;
case 1: /* (d)ate */ case 1: /* (d)ate */
Sort = SORT_DATE; Sort = SORT_DATE;
break; break;
case 2: /* (f)rm */ case 2: /* (f)rm */
Sort = SORT_FROM; Sort = SORT_FROM;
break; break;
case 3: /* (r)ecv */ case 3: /* (r)ecv */
Sort = SORT_RECEIVED; Sort = SORT_RECEIVED;
break; break;
case 4: /* (s)ubj */ case 4: /* (s)ubj */
Sort = SORT_SUBJECT; Sort = SORT_SUBJECT;
break; break;
case 5: /* t(o) */ case 5: /* t(o) */
Sort = SORT_TO; Sort = SORT_TO;
break; break;
case 6: /* (t)hread */ case 6: /* (t)hread */
Sort = SORT_THREADS; Sort = SORT_THREADS;
break; break;
case 7: /* (u)nsort */ case 7: /* (u)nsort */
Sort = SORT_ORDER; Sort = SORT_ORDER;
break; break;
case 8: /* si(z)e */ case 8: /* si(z)e */
Sort = SORT_SIZE; Sort = SORT_SIZE;
break; break;
case 9: /* s(c)ore */ case 9: /* s(c)ore */
Sort = SORT_SCORE; Sort = SORT_SCORE;
break; break;
case 10: /* s(p)am */ case 10: /* s(p)am */
Sort = SORT_SPAM; Sort = SORT_SPAM;
break; break;
case 11: /* (l)abel */ case 11: /* (l)abel */
Sort = SORT_LABEL; Sort = SORT_LABEL;
break; break;
} }
if (reverse) if (reverse)
Sort |= SORT_REVERSE; Sort |= SORT_REVERSE;
...@@ -760,7 +761,7 @@ static void set_copy_flags (HEADER *hdr, int decode, int decrypt, int *cmflags, ...@@ -760,7 +761,7 @@ static void set_copy_flags (HEADER *hdr, int decode, int decrypt, int *cmflags,
*cmflags = MUTT_CM_DECODE_PGP; *cmflags = MUTT_CM_DECODE_PGP;
} }
else if ((WithCrypto & APPLICATION_PGP) else if ((WithCrypto & APPLICATION_PGP)
&& mutt_is_application_pgp (hdr->content) & ENCRYPT) && mutt_is_application_pgp (hdr->content) & ENCRYPT)
decode = 1; decode = 1;
else if ((WithCrypto & APPLICATION_SMIME) else if ((WithCrypto & APPLICATION_SMIME)
&& mutt_is_application_smime(hdr->content) & ENCRYPT) && mutt_is_application_smime(hdr->content) & ENCRYPT)
...@@ -928,7 +929,7 @@ int mutt_save_message (HEADER *h, int delete, int decode, int decrypt) ...@@ -928,7 +929,7 @@ int mutt_save_message (HEADER *h, int delete, int decode, int decrypt)
{ {
mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], MUTT_MESSAGEHOOK); mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], MUTT_MESSAGEHOOK);
if (_mutt_save_message(Context->hdrs[Context->v2r[i]], if (_mutt_save_message(Context->hdrs[Context->v2r[i]],
&ctx, delete, decode, decrypt) != 0) &ctx, delete, decode, decrypt) != 0)
{ {
mx_close_mailbox (&ctx, NULL); mx_close_mailbox (&ctx, NULL);
return -1; return -1;
......
...@@ -79,8 +79,10 @@ int mutt_complete (char *s, size_t slen) ...@@ -79,8 +79,10 @@ 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),
return -1; s + 1, (size_t)(p - s - 1)) == NULL)
{
return -1;
} }
strfcpy (exp_dirpart, buf, sizeof (exp_dirpart)); strfcpy (exp_dirpart, buf, sizeof (exp_dirpart));
mutt_substrcpy(dirpart, s, p+1, sizeof(dirpart)); mutt_substrcpy(dirpart, s, p+1, sizeof(dirpart));
......
This diff is collapsed.
...@@ -359,8 +359,8 @@ escape_path (char *src) ...@@ -359,8 +359,8 @@ escape_path (char *src)
*/ */
static const char * static const char *
cb_format_str (char *dest, size_t destlen, size_t col, int cols, char op, const char *src, cb_format_str (char *dest, size_t destlen, size_t col, int cols, char op, const char *src,
const char *fmt, const char *ifstring, const char *elsestring, const char *fmt, const char *ifstring, const char *elsestring,
unsigned long data, format_flag flags) unsigned long data, format_flag flags)
{ {
if (!dest || (data == 0)) if (!dest || (data == 0))
return src; return src;
......
...@@ -88,8 +88,8 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, ...@@ -88,8 +88,8 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags,
from = 1; from = 1;
} }
else if (flags & (CH_NOQFROM) && else if (flags & (CH_NOQFROM) &&
ascii_strncasecmp (">From ", buf, 6) == 0) ascii_strncasecmp (">From ", buf, 6) == 0)
continue; continue;
else if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n')) else if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n'))
break; /* end of header */ break; /* end of header */
...@@ -325,29 +325,29 @@ mutt_copy_hdr (FILE *in, FILE *out, LOFF_T off_start, LOFF_T off_end, int flags, ...@@ -325,29 +325,29 @@ 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
CH_MIME ignore MIME fields CH_MIME ignore MIME fields
CH_NOLEN don't write Content-Length: and Lines: CH_NOLEN don't write Content-Length: and Lines:
CH_NONEWLINE don't output a newline after the header CH_NONEWLINE don't output a newline after the header
CH_NOSTATUS ignore the Status: and X-Status: CH_NOSTATUS ignore the Status: and X-Status:
CH_PREFIX quote header with $indent_str CH_PREFIX quote header with $indent_str
CH_REORDER output header in order specified by `hdr_order' CH_REORDER output header in order specified by `hdr_order'
CH_TXTPLAIN generate text/plain MIME headers [hack alert.] CH_TXTPLAIN generate text/plain MIME headers [hack alert.]
CH_UPDATE write new Status: and X-Status: CH_UPDATE write new Status: and X-Status:
CH_UPDATE_LEN write new Content-Length: and Lines: CH_UPDATE_LEN write new Content-Length: and Lines:
CH_XMIT ignore Lines: and Content-Length: CH_XMIT ignore Lines: and Content-Length:
CH_WEED do header weeding CH_WEED do header weeding
CH_NOQFROM ignore ">From " line CH_NOQFROM ignore ">From " line
CH_UPDATE_IRT update the In-Reply-To: header CH_UPDATE_IRT update the In-Reply-To: header
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)
...@@ -668,7 +668,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body, ...@@ -668,7 +668,7 @@ _mutt_copy_message (FILE *fpout, FILE *fpin, HEADER *hdr, BODY *body,
if ((WithCrypto & APPLICATION_SMIME) if ((WithCrypto & APPLICATION_SMIME)
&& (flags & MUTT_CM_DECODE_SMIME) && (hdr->security & APPLICATION_SMIME) && (flags & MUTT_CM_DECODE_SMIME) && (hdr->security & APPLICATION_SMIME)
&& hdr->content->type == TYPEAPPLICATION) && hdr->content->type == TYPEAPPLICATION)
{ {
if (crypt_smime_decrypt_mime (fpin, &fp, hdr->content, &cur)) if (crypt_smime_decrypt_mime (fpin, &fp, hdr->content, &cur))
return (-1); return (-1);
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
*/ */