one of your $*_authenticators and (2) you do not have the corresponding
$*_oauth_refresh_command defined. So the message does not mean "None of
your $*_oauth_refresh_command's are defined."
- */
+ */
mutt_error (_("mutt_account_getoauthbearer: No OAUTH refresh command defined"));
return NULL;
}
oauthbearer = safe_malloc (oalen);
snprintf (oauthbearer, oalen,
- "n,a=%s,\001host=%s\001port=%d\001auth=Bearer %s\001\001",
- account->login, account->host, account->port, token);
+ "n,a=%s,\001host=%s\001port=%d\001auth=Bearer %s\001\001",
+ account->login, account->host, account->port, token);
FREE (&token);
if ((SortAlias & SORT_MASK) != SORT_ORDER)
{
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;
return;
- fseek_err:
+fseek_err:
mutt_perror (_("Error seeking in alias file"));
safe_fclose (&rc);
return;
if (!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)
{
bad = l == (size_t)(-1) || l == (size_t)(-2); /* conversion error */
ADDRESS *alias_reverse_lookup (ADDRESS *a)
{
if (!a || !a->mailbox)
- return NULL;
+ return NULL;
return hash_find (ReverseAlias, a->mailbox);
}
else
{
mutt_message (_("No mailcap compose entry for %s, creating empty file."),
- type);
+ type);
rc = 1;
goto bailout;
}
rc = 1;
- bailout:
+bailout:
if(unlink_newfile)
unlink(mutt_b2s (newfile));
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);
}
}
}
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)
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);
}
else
rc = 0;
- return_error:
+return_error:
if (entry)
rfc1524_free_entry (&entry);
/* 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. */
s = strchr (s + 1, '/');
}
- out:
+out:
dprint (3, (debugfile, "bcache: put: '%s'\n", path));
return fp;
s = NONULL (folder->ff->name);
snprintf (fn, sizeof (fn), "%s%s", s,
- folder->ff->local ? (S_ISLNK (folder->ff->mode) ? "@" :
- (S_ISDIR (folder->ff->mode) ? "/" :
- ((folder->ff->mode & S_IXUSR) != 0 ? "*" : ""))) : "");
+ folder->ff->local ?
+ (S_ISLNK (folder->ff->mode) ?
+ "@" :
+ (S_ISDIR (folder->ff->mode) ?
+ "/" :
+ ((folder->ff->mode & S_IXUSR) != 0 ?
+ "*" :
+ ""))) :
+ "");
mutt_format_s (dest, destlen, fmt, fn);
break;
folder.num = num;
mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL(FolderFormat), folder_format_str,
- (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
+ (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
}
static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title,
strfcpy (path, LastDir, sizeof (path));
mutt_pretty_mailbox (path, sizeof (path));
#ifdef USE_IMAP
- if (state->imap_browse && option (OPTIMAPLSUB))
- snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
- path, NONULL (Mask.pattern));
- else
+ if (state->imap_browse && option (OPTIMAPLSUB))
+ snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
+ path, NONULL (Mask.pattern));
+ else
#endif
- snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
- path, NONULL(Mask.pattern));
+ snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
+ path, NONULL(Mask.pattern));
}
menu->redraw = REDRAW_FULL;
}
else
{
#endif
- for (i = mutt_strlen (f) - 1; i > 0 && f[i] != '/' ; i--);
- if (i > 0)
- {
- if (f[0] == '/')
+ for (i = mutt_strlen (f) - 1; i > 0 && f[i] != '/' ; i--);
+ if (i > 0)
{
- if (i > sizeof (LastDir) - 1) i = sizeof (LastDir) - 1;
- strncpy (LastDir, f, i);
- LastDir[i] = 0;
+ if (f[0] == '/')
+ {
+ if (i > sizeof (LastDir) - 1) i = sizeof (LastDir) - 1;
+ strncpy (LastDir, f, i);
+ LastDir[i] = 0;
+ }
+ else
+ {
+ getcwd (LastDir, sizeof (LastDir));
+ safe_strcat (LastDir, sizeof (LastDir), "/");
+ safe_strncat (LastDir, sizeof (LastDir), f, i);
+ }
}
else
{
- getcwd (LastDir, sizeof (LastDir));
- safe_strcat (LastDir, sizeof (LastDir), "/");
- safe_strncat (LastDir, sizeof (LastDir), f, i);
+ if (f[0] == '/')
+ strcpy (LastDir, "/"); /* __STRCPY_CHECKED__ */
+ else
+ getcwd (LastDir, sizeof (LastDir));
}
- }
- else
- {
- if (f[0] == '/')
- strcpy (LastDir, "/"); /* __STRCPY_CHECKED__ */
- else
- getcwd (LastDir, sizeof (LastDir));
- }
- if (i <= 0 && f[0] != '/')
- strfcpy (prefix, f, sizeof (prefix));
- else
- strfcpy (prefix, f + i + 1, sizeof (prefix));
- killPrefix = 1;
+ if (i <= 0 && f[0] != '/')
+ strfcpy (prefix, f, sizeof (prefix));
+ else
+ strfcpy (prefix, f + i + 1, sizeof (prefix));
+ killPrefix = 1;
#ifdef USE_IMAP
}
#endif
}
else
#ifdef USE_IMAP
- if (!state.imap_browse)
+ if (!state.imap_browse)
#endif
- if (examine_directory (NULL, &state, LastDir, prefix) == -1)
- goto bail;
+ if (examine_directory (NULL, &state, LastDir, prefix) == -1)
+ goto bail;
menu = mutt_new_menu (MENU_FOLDER);
menu->make_entry = folder_entry;
menu->tag = file_tag;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER,
- FolderHelp);
+ FolderHelp);
mutt_push_current_menu (menu);
init_menu (&state, menu, title, sizeof (title), buffy);
if (S_ISDIR (state.entry[menu->current].mode) ||
(S_ISLNK (state.entry[menu->current].mode) &&
- link_is_dir (LastDir, state.entry[menu->current].name))
+ link_is_dir (LastDir, state.entry[menu->current].name))
#ifdef USE_IMAP
|| state.entry[menu->current].inferiors
#endif
- )
+ )
{
/* make sure this isn't a MH or maildir mailbox */
if (buffy)
if ((mx_get_magic (buf) <= 0)
#ifdef USE_IMAP
- || state.entry[menu->current].inferiors
+ || state.entry[menu->current].inferiors
#endif
)
{
ciss_url_t url;
strfcpy (LastDir, state.entry[menu->current].name,
- sizeof (LastDir));
+ sizeof (LastDir));
/* tack on delimiter here */
n = strlen (LastDir)+1;
}
else
#endif
- if (examine_directory (menu, &state, LastDir, prefix) == -1)
- {
- /* try to restore the old values */
- strfcpy (LastDir, OldLastDir, sizeof (LastDir));
- if (examine_directory (menu, &state, LastDir, prefix) == -1)
- {
- strfcpy (LastDir, NONULL(Homedir), sizeof (LastDir));
- goto bail;
- }
- }
+ if (examine_directory (menu, &state, LastDir, prefix) == -1)
+ {
+ /* try to restore the old values */
+ strfcpy (LastDir, OldLastDir, sizeof (LastDir));
+ if (examine_directory (menu, &state, LastDir, prefix) == -1)
+ {
+ strfcpy (LastDir, NONULL(Homedir), sizeof (LastDir));
+ goto bail;
+ }
+ }
menu->current = 0;
menu->top = 0;
init_menu (&state, menu, title, sizeof (title), buffy);
}
break;
- case OP_DELETE_MAILBOX:
+ case OP_DELETE_MAILBOX:
if (!state.entry[menu->current].imap)
mutt_error (_("Delete is only supported for IMAP mailboxes"));
else
break;
}
snprintf (msg, sizeof (msg), _("Really delete mailbox \"%s\"?"),
- mx.mbox);
+ mx.mbox);
if (mutt_yesorno (msg, MUTT_NO) == MUTT_YES)
{
if (!imap_delete_mailbox (Context, mx))
/* and move all other entries up */
if (nentry+1 < state.entrylen)
memmove (state.entry + nentry, state.entry + nentry + 1,
- sizeof (struct folder_file) * (state.entrylen - (nentry+1)));
+ sizeof (struct folder_file) * (state.entrylen - (nentry+1)));
memset (&state.entry[state.entrylen - 1], 0,
sizeof (struct folder_file));
state.entrylen--;
}
else
#endif
- if (examine_directory (menu, &state, LastDir, NULL) == 0)
- init_menu (&state, menu, title, sizeof (title), buffy);
- else
- {
- mutt_error _("Error scanning directory.");
- goto bail;
- }
+ if (examine_directory (menu, &state, LastDir, NULL) == 0)
+ init_menu (&state, menu, title, sizeof (title), buffy);
+ else
+ {
+ mutt_error _("Error scanning directory.");
+ goto bail;
+ }
killPrefix = 0;
if (!state.entrylen)
{
case OP_SORT:
case OP_SORT_REVERSE:
- {
- int resort = 1;
- int reverse = (i == OP_SORT_REVERSE);
-
- switch (mutt_multi_choice ((reverse) ?
- _("Reverse sort by (d)ate, (a)lpha, si(z)e, (c)ount, (u)nread, or do(n)'t sort? ") :
- _("Sort by (d)ate, (a)lpha, si(z)e, (c)ount, (u)nread, or do(n)'t sort? "),
- _("dazcun")))
- {
- case -1: /* abort */
- resort = 0;
- break;
-
- case 1: /* (d)ate */
- BrowserSort = SORT_DATE;
- break;
-
- case 2: /* (a)lpha */
- BrowserSort = SORT_SUBJECT;
- break;
-
- case 3: /* si(z)e */
- BrowserSort = SORT_SIZE;
- break;
-
- case 4: /* (c)ount */
- BrowserSort = SORT_COUNT;
- break;
-
- case 5: /* (u)nread */
- BrowserSort = SORT_UNREAD;
- break;
+ {
+ int resort = 1;
+ int reverse = (i == OP_SORT_REVERSE);
- case 6: /* do(n)'t sort */
- BrowserSort = SORT_ORDER;
- resort = 0;
- break;
- }
- if (resort)
- {
- BrowserSort |= reverse ? SORT_REVERSE : 0;
- browser_sort (&state);
- menu->redraw = REDRAW_FULL;
- }
- break;
- }
+ switch (mutt_multi_choice ((reverse) ?
+ _("Reverse sort by (d)ate, (a)lpha, si(z)e, (c)ount, (u)nread, or do(n)'t sort? ") :
+ _("Sort by (d)ate, (a)lpha, si(z)e, (c)ount, (u)nread, or do(n)'t sort? "),
+ _("dazcun")))
+ {
+ case -1: /* abort */
+ resort = 0;
+ break;
+
+ case 1: /* (d)ate */
+ BrowserSort = SORT_DATE;
+ break;
+
+ case 2: /* (a)lpha */
+ BrowserSort = SORT_SUBJECT;
+ break;
+
+ case 3: /* si(z)e */
+ BrowserSort = SORT_SIZE;
+ break;
+
+ case 4: /* (c)ount */
+ BrowserSort = SORT_COUNT;
+ break;
+
+ case 5: /* (u)nread */
+ BrowserSort = SORT_UNREAD;
+ break;
+
+ case 6: /* do(n)'t sort */
+ BrowserSort = SORT_ORDER;
+ resort = 0;
+ break;
+ }
+ if (resort)
+ {
+ BrowserSort |= reverse ? SORT_REVERSE : 0;
+ browser_sort (&state);
+ menu->redraw = REDRAW_FULL;
+ }
+ break;
+ }
case OP_TOGGLE_MAILBOXES:
buffy = 1 - buffy;
}
else
#endif
- if (S_ISDIR (state.entry[menu->current].mode) ||
- (S_ISLNK (state.entry[menu->current].mode) &&
- link_is_dir (LastDir, state.entry[menu->current].name)))
- {
- mutt_error _("Can't view a directory");
- break;
- }
- else
- {
- BODY *b;
- char buf[_POSIX_PATH_MAX];
+ if (S_ISDIR (state.entry[menu->current].mode) ||
+ (S_ISLNK (state.entry[menu->current].mode) &&
+ link_is_dir (LastDir, state.entry[menu->current].name)))
+ {
+ mutt_error _("Can't view a directory");
+ break;
+ }
+ else
+ {
+ BODY *b;
+ char buf[_POSIX_PATH_MAX];
- mutt_concat_path (buf, LastDir, state.entry[menu->current].name, sizeof (buf));
- b = mutt_make_file_attach (buf);
- if (b != NULL)
- {
- mutt_view_attachment (NULL, b, MUTT_REGULAR, NULL, NULL);
- mutt_free_body (&b);
- menu->redraw = REDRAW_FULL;
- }
- else
- mutt_error _("Error trying to view file");
- }
+ mutt_concat_path (buf, LastDir, state.entry[menu->current].name, sizeof (buf));
+ b = mutt_make_file_attach (buf);
+ if (b != NULL)
+ {
+ mutt_view_attachment (NULL, b, MUTT_REGULAR, NULL, NULL);
+ mutt_free_body (&b);
+ menu->redraw = REDRAW_FULL;
+ }
+ else
+ mutt_error _("Error trying to view file");
+ }
}
}
- bail:
+bail:
if (menu)
{
if (!p || !*p)
return;
- FREE (&(*p)->data);
- /* dptr is just an offset to data and shouldn't be freed */
- FREE (p); /* __FREE_CHECKED__ */
+ FREE (&(*p)->data);
+ /* dptr is just an offset to data and shouldn't be freed */
+ FREE (p); /* __FREE_CHECKED__ */
}
void mutt_buffer_clear (BUFFER *b)
tmp->magic = MUTT_POP;
else
#endif
- 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))
- {
- /* if the mailbox still doesn't exist, set the newly created flag to
- * be ready for when it does. */
- tmp->newly_created = 1;
- tmp->magic = 0;
- tmp->size = 0;
- continue;
- }
+ 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))
+ {
+ /* if the mailbox still doesn't exist, set the newly created flag to
+ * be ready for when it does. */
+ tmp->newly_created = 1;
+ tmp->magic = 0;
+ tmp->size = 0;
+ continue;
+ }
}
/* check to see if the folder is the currently selected folder
SLtt_set_color (i, NULL, get_color_name (fgc, sizeof (fgc), fg), get_color_name (bgc, sizeof (bgc), bg));
else
#elif defined (HAVE_USE_DEFAULT_COLORS)
- if (fg == COLOR_DEFAULT)
- fg = -1;
+ if (fg == COLOR_DEFAULT)
+ fg = -1;
if (bg == COLOR_DEFAULT)
bg = -1;
#endif
UserColors--;
dprint(1,(debugfile,"mutt_free_color(): Color pairs used so far: %d\n",
- UserColors));
+ UserColors));
if (p == ColorList)
{
static int
_mutt_parse_uncolor (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err,
- short parse_uncolor);
+ short parse_uncolor);
#ifdef HAVE_COLOR
return (-1);
}
- if(
+ if (
#ifdef HAVE_COLOR
- /* we're running without curses */
- option (OPTNOCURSES)
- || /* we're parsing an uncolor command, and have no colors */
- (parse_uncolor && !has_colors())
- /* we're parsing an unmono command, and have colors */
- || (!parse_uncolor && has_colors())
+ /* we're running without curses */
+ option (OPTNOCURSES)
+ || /* we're parsing an uncolor command, and have no colors */
+ (parse_uncolor && !has_colors())
+ /* we're parsing an unmono command, and have colors */
+ || (!parse_uncolor && has_colors())
#else
- /* We don't even have colors compiled in */
- parse_uncolor
+ /* We don't even have colors compiled in */
+ parse_uncolor
#endif
- )
+ )
{
/* just eat the command, but don't do anything real about it */
do
if (!do_cache)
do_cache = 1;
dprint(1,(debugfile,"Freeing pattern \"%s\" from color list\n",
- tmp->pattern));
+ tmp->pattern));
if (last)
last->next = tmp->next;
else
#ifdef HAVE_COLOR
# ifdef HAVE_USE_DEFAULT_COLORS
if (!option (OPTNOCURSES) && has_colors()
- /* delay use_default_colors() until needed, since it initializes things */
- && (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT)
- && use_default_colors () != OK)
+ /* delay use_default_colors() until needed, since it initializes things */
+ && (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT)
+ && use_default_colors () != OK)
{
strfcpy (err->data, _("default colors not supported"), err->dsize);
return (-1);
}
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)
{
mutt_error (_("Could not copy message"));
char *err = NULL;
int rc;
- /* RfC 5322 mandates a From: header, so warn before bouncing
- * messages without one */
+ /* RfC 5322 mandates a From: header, so warn before bouncing
+ * messages without one */
if (h)
{
if (!h->env->from)
#define extra_space (15 + 7 + 2)
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 (query_quadoption (OPT_PRINT,
h ? _("Print message?") : _("Print tagged messages?"))
- != MUTT_YES)
+ != MUTT_YES)
return;
if (_mutt_pipe_message (h, PrintCmd,
_("Sort Date/Frm/Recv/Subj/tO/Thread/Unsort/siZe/sCore/sPam/Label?: "),
_("dfrsotuzcpl")))
{
- case -1: /* abort - don't resort */
- return -1;
+ case -1: /* abort - don't resort */
+ return -1;
- case 1: /* (d)ate */
- Sort = SORT_DATE;
- break;
+ case 1: /* (d)ate */
+ Sort = SORT_DATE;
+ break;
- case 2: /* (f)rm */
- Sort = SORT_FROM;
- break;
+ case 2: /* (f)rm */
+ Sort = SORT_FROM;
+ break;
- case 3: /* (r)ecv */
- Sort = SORT_RECEIVED;
- break;
+ case 3: /* (r)ecv */
+ Sort = SORT_RECEIVED;
+ break;
- case 4: /* (s)ubj */
- Sort = SORT_SUBJECT;
- break;
+ case 4: /* (s)ubj */
+ Sort = SORT_SUBJECT;
+ break;
- case 5: /* t(o) */
- Sort = SORT_TO;
- break;
+ case 5: /* t(o) */
+ Sort = SORT_TO;
+ break;
- case 6: /* (t)hread */
- Sort = SORT_THREADS;
- break;
+ case 6: /* (t)hread */
+ Sort = SORT_THREADS;
+ break;
- case 7: /* (u)nsort */
- Sort = SORT_ORDER;
- break;
+ case 7: /* (u)nsort */
+ Sort = SORT_ORDER;
+ break;
- case 8: /* si(z)e */
- Sort = SORT_SIZE;
- break;
+ case 8: /* si(z)e */
+ Sort = SORT_SIZE;
+ break;
- case 9: /* s(c)ore */
- Sort = SORT_SCORE;
- break;
+ case 9: /* s(c)ore */
+ Sort = SORT_SCORE;
+ break;
- case 10: /* s(p)am */
- Sort = SORT_SPAM;
- break;
+ case 10: /* s(p)am */
+ Sort = SORT_SPAM;
+ break;
- case 11: /* (l)abel */
- Sort = SORT_LABEL;
- break;
+ case 11: /* (l)abel */
+ Sort = SORT_LABEL;
+ break;
}
if (reverse)
Sort |= SORT_REVERSE;
*cmflags = MUTT_CM_DECODE_PGP;
}
else if ((WithCrypto & APPLICATION_PGP)
- && mutt_is_application_pgp (hdr->content) & ENCRYPT)
+ && mutt_is_application_pgp (hdr->content) & ENCRYPT)
decode = 1;
else if ((WithCrypto & APPLICATION_SMIME)
&& mutt_is_application_smime(hdr->content) & ENCRYPT)
{
mutt_message_hook (Context, Context->hdrs[Context->v2r[i]], MUTT_MESSAGEHOOK);
if (_mutt_save_message(Context->hdrs[Context->v2r[i]],
- &ctx, delete, decode, decrypt) != 0)
+ &ctx, delete, decode, decrypt) != 0)
{
mx_close_mailbox (&ctx, NULL);
return -1;
if ((p = strrchr (s, '/')))
{
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) {
- return -1;
+ if (mutt_concatn_path (buf, sizeof(buf), exp_dirpart, strlen(exp_dirpart),
+ s + 1, (size_t)(p - s - 1)) == NULL)
+ {
+ return -1;
}
strfcpy (exp_dirpart, buf, sizeof (exp_dirpart));
mutt_substrcpy(dirpart, s, p+1, sizeof(dirpart));
ATTACH_CONTEXT *actx = (ATTACH_CONTEXT *)menu->data;
mutt_FormatString (b, blen, 0, MuttIndexWindow->cols, NONULL (AttachFormat), mutt_attach_fmt,
- (unsigned long)(actx->idx[actx->v2r[num]]),
- MUTT_FORMAT_STAT_FILE | MUTT_FORMAT_ARROWCURSOR);
+ (unsigned long)(actx->idx[actx->v2r[num]]),
+ MUTT_FORMAT_STAT_FILE | MUTT_FORMAT_ARROWCURSOR);
}
}
if (option (OPTCRYPTOPPORTUNISTICENCRYPT) && (msg->security & OPPENCRYPT))
- addstr (_(" (OppEnc mode)"));
+ addstr (_(" (OppEnc mode)"));
mutt_window_clrtoeol (MuttIndexWindow);
mutt_window_move (MuttIndexWindow, HDR_CRYPTINFO, 0);
{
if (m->type == TYPEMULTIPART && m->parts
&& (!(WithCrypto & APPLICATION_PGP) || !mutt_is_multipart_encrypted(m))
- )
+ )
{
mutt_gen_compose_attach_list (actx, m->parts, m->type, level);
}
/* prototype for use below */
static void compose_status_line (char *buf, size_t buflen, size_t col, int cols, MUTTMENU *menu,
- const char *p);
+ const char *p);
/*
* compose_format_str()
static const char *
compose_format_str (char *buf, size_t buflen, size_t col, int cols, char op, const char *src,
- const char *prefix, const char *ifstring,
- const char *elsestring,
- unsigned long data, format_flag flags)
+ const char *prefix, const char *ifstring,
+ const char *elsestring,
+ unsigned long data, format_flag flags)
{
char fmt[SHORT_STRING], tmp[SHORT_STRING];
int optional = (flags & MUTT_FORMAT_OPTIONAL);
switch (op)
{
case 'a': /* total number of attachments */
- snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
- snprintf (buf, buflen, fmt, menu->max);
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+ snprintf (buf, buflen, fmt, menu->max);
break;
case 'h': /* hostname */
break;
case 'l': /* approx length of current message in bytes */
- snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
- mutt_pretty_size (tmp, sizeof (tmp), menu ? cum_attachs_size(menu) : 0);
- snprintf (buf, buflen, fmt, tmp);
+ snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
+ mutt_pretty_size (tmp, sizeof (tmp), menu ? cum_attachs_size(menu) : 0);
+ snprintf (buf, buflen, fmt, tmp);
break;
case 'v':
MUTTMENU *menu, const char *p)
{
mutt_FormatString (buf, buflen, col, cols, p, compose_format_str,
- (unsigned long) menu, 0);
+ (unsigned long) menu, 0);
}
typedef struct
case OP_COMPOSE_EDIT_HEADERS:
if (mutt_strcmp ("builtin", Editor) != 0 &&
(op == OP_COMPOSE_EDIT_HEADERS ||
- (op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS))))
+ (op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS))))
{
char *tag = NULL, *err = NULL;
mutt_env_to_local (msg->env);
case OP_COMPOSE_ATTACH_FILE:
- {
- char *prompt, **files;
- int error, numfiles;
+ {
+ char *prompt, **files;
+ int error, numfiles;
- fname[0] = 0;
- prompt = _("Attach file");
- numfiles = 0;
- files = NULL;
+ fname[0] = 0;
+ prompt = _("Attach file");
+ numfiles = 0;
+ files = NULL;
- if (_mutt_enter_fname (prompt, fname, sizeof (fname), 0, 1, &files, &numfiles) == -1 ||
- *fname == '\0')
- break;
+ if (_mutt_enter_fname (prompt, fname, sizeof (fname), 0, 1, &files, &numfiles) == -1 ||
+ *fname == '\0')
+ break;
- error = 0;
- if (numfiles > 1)
- mutt_message _("Attaching selected files...");
- for (i = 0; i < numfiles; i++)
- {
- char *att = files[i];
- new = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
- new->unowned = 1;
- new->content = mutt_make_file_attach (att);
- if (new->content != NULL)
- update_idx (menu, actx, new);
- else
- {
- error = 1;
- mutt_error (_("Unable to attach %s!"), att);
- FREE (&new);
- }
- FREE (&files[i]);
- }
+ error = 0;
+ if (numfiles > 1)
+ mutt_message _("Attaching selected files...");
+ for (i = 0; i < numfiles; i++)
+ {
+ char *att = files[i];
+ new = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ new->unowned = 1;
+ new->content = mutt_make_file_attach (att);
+ if (new->content != NULL)
+ update_idx (menu, actx, new);
+ else
+ {
+ error = 1;
+ mutt_error (_("Unable to attach %s!"), att);
+ FREE (&new);
+ }
+ FREE (&files[i]);
+ }
- FREE (&files);
- if (!error) mutt_clear_error ();
+ FREE (&files);
+ if (!error) mutt_clear_error ();
- menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
- }
- mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
- break;
+ menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
+ }
+ mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
+ break;
case OP_COMPOSE_ATTACH_MESSAGE:
- {
- char *prompt;
- HEADER *h;
+ {
+ char *prompt;
+ HEADER *h;
- fname[0] = 0;
- prompt = _("Open mailbox to attach message from");
+ fname[0] = 0;
+ prompt = _("Open mailbox to attach message from");
- if (Context)
- {
- strfcpy (fname, NONULL (Context->path), sizeof (fname));
- mutt_pretty_mailbox (fname, sizeof (fname));
- }
+ if (Context)
+ {
+ strfcpy (fname, NONULL (Context->path), sizeof (fname));
+ mutt_pretty_mailbox (fname, sizeof (fname));
+ }
- if (mutt_enter_fname (prompt, fname, sizeof (fname), 1) == -1 || !fname[0])
- break;
+ if (mutt_enter_fname (prompt, fname, sizeof (fname), 1) == -1 || !fname[0])
+ break;
- mutt_expand_path (fname, sizeof (fname));
+ mutt_expand_path (fname, sizeof (fname));
#ifdef USE_IMAP
- if (!mx_is_imap (fname))
+ if (!mx_is_imap (fname))
#endif
#ifdef USE_POP
if (!mx_is_pop (fname))
#endif
- /* check to make sure the file exists and is readable */
- if (access (fname, R_OK) == -1)
- {
- mutt_perror (fname);
- break;
- }
+ /* check to make sure the file exists and is readable */
+ if (access (fname, R_OK) == -1)
+ {
+ mutt_perror (fname);
+ break;
+ }
- menu->redraw = REDRAW_FULL;
+ menu->redraw = REDRAW_FULL;
- ctx = mx_open_mailbox (fname, MUTT_READONLY, NULL);
- if (ctx == NULL)
- {
- mutt_error (_("Unable to open mailbox %s"), fname);
- break;
- }
+ ctx = mx_open_mailbox (fname, MUTT_READONLY, NULL);
+ if (ctx == NULL)
+ {
+ mutt_error (_("Unable to open mailbox %s"), fname);
+ break;
+ }
- if (!ctx->msgcount)
- {
- mx_close_mailbox (ctx, NULL);
- FREE (&ctx);
- mutt_error _("No messages in that folder.");
- break;
- }
+ if (!ctx->msgcount)
+ {
+ mx_close_mailbox (ctx, NULL);
+ FREE (&ctx);
+ mutt_error _("No messages in that folder.");
+ break;
+ }
- this = Context; /* remember current folder and sort methods*/
- oldSort = Sort; oldSortAux = SortAux;
+ this = Context; /* remember current folder and sort methods*/
+ oldSort = Sort; oldSortAux = SortAux;
- Context = ctx;
- set_option(OPTATTACHMSG);
- mutt_message _("Tag the messages you want to attach!");
- close = mutt_index_menu ();
- unset_option(OPTATTACHMSG);
+ Context = ctx;
+ set_option(OPTATTACHMSG);
+ mutt_message _("Tag the messages you want to attach!");
+ close = mutt_index_menu ();
+ unset_option(OPTATTACHMSG);
- if (!Context)
- {
- /* go back to the folder we started from */
- Context = this;
- /* Restore old $sort and $sort_aux */
- Sort = oldSort;
- SortAux = oldSortAux;
- menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
- break;
- }
+ if (!Context)
+ {
+ /* go back to the folder we started from */
+ Context = this;
+ /* Restore old $sort and $sort_aux */
+ Sort = oldSort;
+ SortAux = oldSortAux;
+ menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
+ break;
+ }
- for (i = 0; i < Context->msgcount; i++)
- {
- h = Context->hdrs[i];
- if (h->tagged)
- {
- new = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
- new->content = mutt_make_message_attach (Context, h, 1);
- if (new->content != NULL)
- update_idx (menu, actx, new);
- else
- {
- mutt_error _("Unable to attach!");
- FREE (&new);
- }
- }
- }
- menu->redraw |= REDRAW_FULL;
+ for (i = 0; i < Context->msgcount; i++)
+ {
+ h = Context->hdrs[i];
+ if (h->tagged)
+ {
+ new = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ new->content = mutt_make_message_attach (Context, h, 1);
+ if (new->content != NULL)
+ update_idx (menu, actx, new);
+ else
+ {
+ mutt_error _("Unable to attach!");
+ FREE (&new);
+ }
+ }
+ }
+ menu->redraw |= REDRAW_FULL;
- if (close == OP_QUIT)
- mx_close_mailbox (Context, NULL);
- else
- mx_fastclose_mailbox (Context);
- FREE (&Context);
-
- /* go back to the folder we started from */
- Context = this;
- /* Restore old $sort and $sort_aux */
- Sort = oldSort;
- SortAux = oldSortAux;
- }
- mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
- break;
+ if (close == OP_QUIT)
+ mx_close_mailbox (Context, NULL);
+ else
+ mx_fastclose_mailbox (Context);
+ FREE (&Context);
+
+ /* go back to the folder we started from */
+ Context = this;
+ /* Restore old $sort and $sort_aux */
+ Sort = oldSort;
+ SortAux = oldSortAux;
+ }
+ mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
+ break;
case OP_DELETE:
CHECK_COUNT;
case OP_COMPOSE_EDIT_ENCODING:
CHECK_COUNT;
strfcpy (buf, ENCODING (CURATTACH->content->encoding),
- sizeof (buf));
+ sizeof (buf));
if (mutt_get_field ("Content-Transfer-Encoding: ", buf,
- sizeof (buf), 0) == 0 && buf[0])
+ sizeof (buf), 0) == 0 && buf[0])
{
if ((i = mutt_check_encoding (buf)) != ENCOTHER && i != ENCUUENCODED)
{
if (!fccSet && *fcc)
{
if ((i = query_quadoption (OPT_COPY,
- _("Save a copy of this message?"))) == -1)
+ _("Save a copy of this message?"))) == -1)
break;
else if (i == MUTT_NO)
*fcc = 0;
break;
case OP_COMPOSE_RENAME_ATTACHMENT:
- {
- char *src;
- int ret;
+ {
+ char *src;
+ int ret;
- CHECK_COUNT;
- if (CURATTACH->content->d_filename)
- src = CURATTACH->content->d_filename;
- else
- src = CURATTACH->content->filename;
- strfcpy (fname, mutt_basename (NONULL (src)), sizeof (fname));
- ret = mutt_get_field (_("Send attachment with name: "),
- fname, sizeof (fname), MUTT_FILE);
- if (ret == 0)
- {
- /*
- * As opposed to RENAME_FILE, we don't check fname[0] because it's
- * valid to set an empty string here, to erase what was set
- */
- mutt_str_replace (&CURATTACH->content->d_filename, fname);
- menu->redraw = REDRAW_CURRENT;
- }
+ CHECK_COUNT;
+ if (CURATTACH->content->d_filename)
+ src = CURATTACH->content->d_filename;
+ else
+ src = CURATTACH->content->filename;
+ strfcpy (fname, mutt_basename (NONULL (src)), sizeof (fname));
+ ret = mutt_get_field (_("Send attachment with name: "),
+ fname, sizeof (fname), MUTT_FILE);
+ if (ret == 0)
+ {
+ /*
+ * As opposed to RENAME_FILE, we don't check fname[0] because it's
+ * valid to set an empty string here, to erase what was set
+ */
+ mutt_str_replace (&CURATTACH->content->d_filename, fname);
+ menu->redraw = REDRAW_CURRENT;
}
- break;
+ }
+ break;
case OP_COMPOSE_RENAME_FILE:
CHECK_COUNT;
strfcpy (fname, CURATTACH->content->filename, sizeof (fname));
mutt_pretty_mailbox (fname, sizeof (fname));
- if (mutt_get_field (_("Rename to: "), fname, sizeof (fname), MUTT_FILE)
- == 0 && fname[0])
+ if ((mutt_get_field (_("Rename to: "), fname, sizeof (fname), MUTT_FILE) == 0)
+ && fname[0])
{
if (stat(CURATTACH->content->filename, &st) == -1)
{
break;
case OP_COMPOSE_NEW_MIME:
- {
- char type[STRING];
- char *p;
- int itype;
- FILE *fp;
-
- mutt_window_clearline (MuttMessageWindow, 0);
- fname[0] = 0;
- if (mutt_get_field (_("New file: "), fname, sizeof (fname), MUTT_FILE)
- != 0 || !fname[0])
- continue;
- mutt_expand_path (fname, sizeof (fname));
-
- /* Call to lookup_mime_type () ? maybe later */
- type[0] = 0;
- if (mutt_get_field ("Content-Type: ", type, sizeof (type), 0) != 0
- || !type[0])
- continue;
-
- if (!(p = strchr (type, '/')))
- {
- mutt_error _("Content-Type is of the form base/sub");
- continue;
- }
- *p++ = 0;
- if ((itype = mutt_check_mime_type (type)) == TYPEOTHER)
- {
- mutt_error (_("Unknown Content-Type %s"), type);
- continue;
- }
+ {
+ char type[STRING];
+ char *p;
+ int itype;
+ FILE *fp;
+
+ mutt_window_clearline (MuttMessageWindow, 0);
+ fname[0] = 0;
+ if (mutt_get_field (_("New file: "), fname, sizeof (fname), MUTT_FILE)
+ != 0 || !fname[0])
+ continue;
+ mutt_expand_path (fname, sizeof (fname));
+
+ /* Call to lookup_mime_type () ? maybe later */
+ type[0] = 0;
+ if (mutt_get_field ("Content-Type: ", type, sizeof (type), 0) != 0
+ || !type[0])
+ continue;
+
+ if (!(p = strchr (type, '/')))
+ {
+ mutt_error _("Content-Type is of the form base/sub");
+ continue;
+ }
+ *p++ = 0;
+ if ((itype = mutt_check_mime_type (type)) == TYPEOTHER)
+ {
+ mutt_error (_("Unknown Content-Type %s"), type);
+ continue;
+ }
- new = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
- /* Touch the file */
- if (!(fp = safe_fopen (fname, "w")))
- {
- mutt_error (_("Can't create file %s"), fname);
- FREE (&new);
- continue;
- }
- safe_fclose (&fp);
+ new = (ATTACHPTR *) safe_calloc (1, sizeof (ATTACHPTR));
+ /* Touch the file */
+ if (!(fp = safe_fopen (fname, "w")))
+ {
+ mutt_error (_("Can't create file %s"), fname);
+ FREE (&new);
+ continue;
+ }
+ safe_fclose (&fp);
- if ((new->content = mutt_make_file_attach (fname)) == NULL)
- {
- mutt_error _("What we have here is a failure to make an attachment");
- FREE (&new);
- continue;
- }
- update_idx (menu, actx, new);
+ if ((new->content = mutt_make_file_attach (fname)) == NULL)
+ {
+ mutt_error _("What we have here is a failure to make an attachment");
+ FREE (&new);
+ continue;
+ }
+ update_idx (menu, actx, new);
- CURATTACH->content->type = itype;
- mutt_str_replace (&CURATTACH->content->subtype, p);
- CURATTACH->content->unlink = 1;
- menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
+ CURATTACH->content->type = itype;
+ mutt_str_replace (&CURATTACH->content->subtype, p);
+ CURATTACH->content->unlink = 1;
+ menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
- if (mutt_compose_attachment (CURATTACH->content))
- {
- mutt_update_encoding (CURATTACH->content);
- menu->redraw = REDRAW_FULL;
- }
- }
- mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
- break;
+ if (mutt_compose_attachment (CURATTACH->content))
+ {
+ mutt_update_encoding (CURATTACH->content);
+ menu->redraw = REDRAW_FULL;
+ }
+ }
+ mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
+ break;
case OP_COMPOSE_EDIT_MIME:
CHECK_COUNT;
case OP_COMPOSE_WRITE_MESSAGE:
- fname[0] = '\0';
- if (Context)
- {
- strfcpy (fname, NONULL (Context->path), sizeof (fname));
- mutt_pretty_mailbox (fname, sizeof (fname));
- }
- if (actx->idxlen)
- msg->content = actx->idx[0]->content;
- if (mutt_enter_fname (_("Write message to mailbox"), fname, sizeof (fname),
- 1) != -1 && fname[0])
- {
- mutt_message (_("Writing message to %s ..."), fname);
- mutt_expand_path (fname, sizeof (fname));
+ fname[0] = '\0';
+ if (Context)
+ {
+ strfcpy (fname, NONULL (Context->path), sizeof (fname));
+ mutt_pretty_mailbox (fname, sizeof (fname));
+ }
+ if (actx->idxlen)
+ msg->content = actx->idx[0]->content;
+ if (mutt_enter_fname (_("Write message to mailbox"), fname, sizeof (fname),
+ 1) != -1 && fname[0])
+ {
+ mutt_message (_("Writing message to %s ..."), fname);
+ mutt_expand_path (fname, sizeof (fname));
- if (msg->content->next)
- msg->content = mutt_make_multipart (msg->content);
+ if (msg->content->next)
+ msg->content = mutt_make_multipart (msg->content);
- if (mutt_write_fcc (fname, msg, NULL, 0, NULL) < 0)
- msg->content = mutt_remove_multipart (msg->content);
- else
- mutt_message _("Message written.");
- }
- break;
+ if (mutt_write_fcc (fname, msg, NULL, 0, NULL) < 0)
+ msg->content = mutt_remove_multipart (msg->content);
+ else
+ mutt_message _("Message written.");
+ }
+ break;
if (msg->security & (ENCRYPT | SIGN))
{
if (mutt_yesorno (_("PGP already selected. Clear & continue ? "),
- MUTT_YES) != MUTT_YES)
+ MUTT_YES) != MUTT_YES)
{
mutt_clear_error ();
break;
*/
static const char *
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,
- unsigned long data, format_flag flags)
+ const char *fmt, const char *ifstring, const char *elsestring,
+ unsigned long data, format_flag flags)
{
if (!dest || (data == 0))
return src;
from = 1;
}
else if (flags & (CH_NOQFROM) &&
- ascii_strncasecmp (">From ", buf, 6) == 0)
- continue;
+ ascii_strncasecmp (">From ", buf, 6) == 0)
+ continue;
else if (buf[0] == '\n' || (buf[0] == '\r' && buf[1] == '\n'))
break; /* end of header */
return (0);
}
-/* flags
- CH_DECODE RFC2047 header decoding
- CH_FROM retain the "From " message separator
- CH_FORCE_FROM give CH_FROM precedence over CH_WEED
- CH_MIME ignore MIME fields
- CH_NOLEN don't write Content-Length: and Lines:
- CH_NONEWLINE don't output a newline after the header
- CH_NOSTATUS ignore the Status: and X-Status:
- CH_PREFIX quote header with $indent_str
- CH_REORDER output header in order specified by `hdr_order'
- CH_TXTPLAIN generate text/plain MIME headers [hack alert.]
- CH_UPDATE write new Status: and X-Status:
- CH_UPDATE_LEN write new Content-Length: and Lines:
- CH_XMIT ignore Lines: and Content-Length:
- CH_WEED do header weeding
- CH_NOQFROM ignore ">From " line
- CH_UPDATE_IRT update the In-Reply-To: header
- CH_UPDATE_REFS update the References: header
- CH_UPDATE_LABEL update the X-Label: header
-
- prefix
- string to use if CH_PREFIX is set
- */
+/* flags:
+ CH_DECODE RFC2047 header decoding
+ CH_FROM retain the "From " message separator
+ CH_FORCE_FROM give CH_FROM precedence over CH_WEED
+ CH_MIME ignore MIME fields
+ CH_NOLEN don't write Content-Length: and Lines:
+ CH_NONEWLINE don't output a newline after the header
+ CH_NOSTATUS ignore the Status: and X-Status:
+ CH_PREFIX quote header with $indent_str
+ CH_REORDER output header in order specified by `hdr_order'
+ CH_TXTPLAIN generate text/plain MIME headers [hack alert.]
+ CH_UPDATE write new Status: and X-Status:
+ CH_UPDATE_LEN write new Content-Length: and Lines:
+ CH_XMIT ignore Lines: and Content-Length:
+ CH_WEED do header weeding
+ CH_NOQFROM ignore ">From " line
+ CH_UPDATE_IRT update the In-Reply-To: header
+ CH_UPDATE_REFS update the References: header
+ CH_UPDATE_LABEL update the X-Label: header
+
+ prefix:
+ string to use if CH_PREFIX is set
+*/
int
mutt_copy_header (FILE *in, HEADER *h, FILE *out, int flags, const char *prefix)
if ((WithCrypto & 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))
return (-1);
*/
/*
- This is a crytpo module wrapping the classic pgp code.
- */
+ This is a crytpo module wrapping the classic pgp code.
+*/
#if HAVE_CONFIG_H
# include "config.h"
}
struct crypt_module_specs crypt_mod_pgp_classic =
- { APPLICATION_PGP,
- {
- NULL, /* init */
- crypt_mod_pgp_void_passphrase,
- crypt_mod_pgp_valid_passphrase,
- crypt_mod_pgp_decrypt_mime,
- crypt_mod_pgp_application_handler,
- crypt_mod_pgp_encrypted_handler,
- crypt_mod_pgp_findkeys,
- crypt_mod_pgp_sign_message,
- crypt_mod_pgp_verify_one,
- crypt_mod_pgp_send_menu,
- NULL, /* (set_sender) */
-
- crypt_mod_pgp_encrypt_message,
- crypt_mod_pgp_make_key_attachment,
- crypt_mod_pgp_check_traditional,
- crypt_mod_pgp_traditional_encryptsign,
- crypt_mod_pgp_invoke_getkeys,
- crypt_mod_pgp_invoke_import,
- crypt_mod_pgp_extract_keys_from_attachment_list,
-
- NULL, /* smime_getkeys */
- NULL, /* smime_verify_sender */
- NULL, /* smime_build_smime_entity */
- NULL, /* smime_invoke_import */
- }
- };
+{ APPLICATION_PGP,
+ {
+ NULL, /* init */
+ crypt_mod_pgp_void_passphrase,
+ crypt_mod_pgp_valid_passphrase,
+ crypt_mod_pgp_decrypt_mime,
+ crypt_mod_pgp_application_handler,
+ crypt_mod_pgp_encrypted_handler,
+ crypt_mod_pgp_findkeys,
+ crypt_mod_pgp_sign_message,
+ crypt_mod_pgp_verify_one,
+ crypt_mod_pgp_send_menu,
+ NULL, /* (set_sender) */
+
+ crypt_mod_pgp_encrypt_message,
+ crypt_mod_pgp_make_key_attachment,
+ crypt_mod_pgp_check_traditional,
+ crypt_mod_pgp_traditional_encryptsign,
+ crypt_mod_pgp_invoke_getkeys,
+ crypt_mod_pgp_invoke_import,
+ crypt_mod_pgp_extract_keys_from_attachment_list,
+
+ NULL, /* smime_getkeys */
+ NULL, /* smime_verify_sender */
+ NULL, /* smime_build_smime_entity */
+ NULL, /* smime_invoke_import */
+ }
+};
*/
/*
- 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
# include "config.h"
}
struct crypt_module_specs crypt_mod_pgp_gpgme =
- { APPLICATION_PGP,
- {
- /* Common. */
- crypt_mod_pgp_init,
- crypt_mod_pgp_void_passphrase,
- crypt_mod_pgp_valid_passphrase,
- crypt_mod_pgp_decrypt_mime,
- crypt_mod_pgp_application_handler,
- crypt_mod_pgp_encrypted_handler,
- crypt_mod_pgp_findkeys,
- crypt_mod_pgp_sign_message,
- crypt_mod_pgp_verify_one,
- crypt_mod_pgp_send_menu,
- crypt_mod_pgp_set_sender,
-
- /* PGP specific. */
- crypt_mod_pgp_encrypt_message,
- crypt_mod_pgp_make_key_attachment,
- crypt_mod_pgp_check_traditional,
- NULL, /* pgp_traditional_encryptsign */
- NULL, /* pgp_invoke_getkeys */
- crypt_mod_pgp_invoke_import,
- NULL, /* pgp_extract_keys_from_attachment_list */
-
- NULL, /* smime_getkeys */
- NULL, /* smime_verify_sender */
- NULL, /* smime_build_smime_entity */
- NULL, /* smime_invoke_import */
- }
- };
+{ APPLICATION_PGP,
+ {
+ /* Common. */
+ crypt_mod_pgp_init,
+ crypt_mod_pgp_void_passphrase,
+ crypt_mod_pgp_valid_passphrase,
+ crypt_mod_pgp_decrypt_mime,
+ crypt_mod_pgp_application_handler,
+ crypt_mod_pgp_encrypted_handler,
+ crypt_mod_pgp_findkeys,
+ crypt_mod_pgp_sign_message,
+ crypt_mod_pgp_verify_one,
+ crypt_mod_pgp_send_menu,
+ crypt_mod_pgp_set_sender,
+
+ /* PGP specific. */
+ crypt_mod_pgp_encrypt_message,
+ crypt_mod_pgp_make_key_attachment,
+ crypt_mod_pgp_check_traditional,
+ NULL, /* pgp_traditional_encryptsign */
+ NULL, /* pgp_invoke_getkeys */
+ crypt_mod_pgp_invoke_import,
+ NULL, /* pgp_extract_keys_from_attachment_list */
+
+ NULL, /* smime_getkeys */
+ NULL, /* smime_verify_sender */
+ NULL, /* smime_build_smime_entity */
+ NULL, /* smime_invoke_import */
+ }
+};
#endif
*/
/*
- This is a crytpo module wrapping the classic smime code.
- */
+ This is a crytpo module wrapping the classic smime code.
+*/
#if HAVE_CONFIG_H
# include "config.h"
struct crypt_module_specs crypt_mod_smime_classic =
- { APPLICATION_SMIME,
- {
- NULL, /* init */
- crypt_mod_smime_void_passphrase,
- crypt_mod_smime_valid_passphrase,
- crypt_mod_smime_decrypt_mime,
- crypt_mod_smime_application_handler,
- NULL, /* encrypted_handler */
- crypt_mod_smime_findkeys,
- crypt_mod_smime_sign_message,
- crypt_mod_smime_verify_one,
- crypt_mod_smime_send_menu,
- NULL,
-
- NULL, /* pgp_encrypt_message */
- NULL, /* pgp_make_key_attachment */
- NULL, /* pgp_check_traditional */
- NULL, /* pgp_traditional_encryptsign */
- NULL, /* pgp_invoke_getkeys */
- NULL, /* pgp_invoke_import */
- NULL, /* pgp_extract_keys_from_attachment_list */
-
- crypt_mod_smime_getkeys,
- crypt_mod_smime_verify_sender,
- crypt_mod_smime_build_smime_entity,
- crypt_mod_smime_invoke_import,
- }
- };
+{ APPLICATION_SMIME,
+ {
+ NULL, /* init */
+ crypt_mod_smime_void_passphrase,
+ crypt_mod_smime_valid_passphrase,
+ crypt_mod_smime_decrypt_mime,
+ crypt_mod_smime_application_handler,
+ NULL, /* encrypted_handler */
+ crypt_mod_smime_findkeys,
+ crypt_mod_smime_sign_message,
+ crypt_mod_smime_verify_one,
+ crypt_mod_smime_send_menu,
+ NULL,
+
+ NULL, /* pgp_encrypt_message */
+ NULL, /* pgp_make_key_attachment */
+ NULL, /* pgp_check_traditional */
+ NULL, /* pgp_traditional_encryptsign */
+ NULL, /* pgp_invoke_getkeys */
+ NULL, /* pgp_invoke_import */
+ NULL, /* pgp_extract_keys_from_attachment_list */
+
+ crypt_mod_smime_getkeys,
+ crypt_mod_smime_verify_sender,
+ crypt_mod_smime_build_smime_entity,
+ crypt_mod_smime_invoke_import,
+ }
+};
*/
/*
- 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
# include "config.h"
}
struct crypt_module_specs crypt_mod_smime_gpgme =
- { APPLICATION_SMIME,
- {
- crypt_mod_smime_init,
- crypt_mod_smime_void_passphrase,
- crypt_mod_smime_valid_passphrase,
- crypt_mod_smime_decrypt_mime,
- crypt_mod_smime_application_handler,
- NULL, /* encrypted_handler */
- crypt_mod_smime_findkeys,
- crypt_mod_smime_sign_message,
- crypt_mod_smime_verify_one,
- crypt_mod_smime_send_menu,
- NULL,
-
- NULL, /* pgp_encrypt_message */
- NULL, /* pgp_make_key_attachment */
- NULL, /* pgp_check_traditional */
- NULL, /* pgp_traditional_encryptsign */
- NULL, /* pgp_invoke_getkeys */
- NULL, /* pgp_invoke_import */
- NULL, /* pgp_extract_keys_from_attachment_list */
-
- NULL, /* smime_getkeys */
- crypt_mod_smime_verify_sender,
- crypt_mod_smime_build_smime_entity,
- NULL, /* smime_invoke_import */
- }
- };
+{ APPLICATION_SMIME,
+ {
+ crypt_mod_smime_init,
+ crypt_mod_smime_void_passphrase,
+ crypt_mod_smime_valid_passphrase,
+ crypt_mod_smime_decrypt_mime,
+ crypt_mod_smime_application_handler,
+ NULL, /* encrypted_handler */
+ crypt_mod_smime_findkeys,
+ crypt_mod_smime_sign_message,
+ crypt_mod_smime_verify_one,
+ crypt_mod_smime_send_menu,
+ NULL,
+
+ NULL, /* pgp_encrypt_message */
+ NULL, /* pgp_make_key_attachment */
+ NULL, /* pgp_check_traditional */
+ NULL, /* pgp_traditional_encryptsign */
+ NULL, /* pgp_invoke_getkeys */
+ NULL, /* pgp_invoke_import */
+ NULL, /* pgp_extract_keys_from_attachment_list */
+
+ NULL, /* smime_getkeys */
+ crypt_mod_smime_verify_sender,
+ crypt_mod_smime_build_smime_entity,
+ NULL, /* smime_invoke_import */
+ }
+};
#endif
tmp_pgp_pbody = msg->content;
if (option (OPTCRYPTUSEPKA) && (msg->security & SIGN))
- {
- /* Set sender (necessary for e.g. PKA). */
+ {
+ /* Set sender (necessary for e.g. PKA). */
- if ((WithCrypto & APPLICATION_SMIME)
- && (msg->security & APPLICATION_SMIME))
- crypt_smime_set_sender (msg->env->from->mailbox);
- else if ((WithCrypto & APPLICATION_PGP)
- && (msg->security & APPLICATION_PGP))
- crypt_pgp_set_sender (msg->env->from->mailbox);
- }
+ if ((WithCrypto & APPLICATION_SMIME)
+ && (msg->security & APPLICATION_SMIME))
+ crypt_smime_set_sender (msg->env->from->mailbox);
+ else if ((WithCrypto & APPLICATION_PGP)
+ && (msg->security & APPLICATION_PGP))
+ crypt_pgp_set_sender (msg->env->from->mailbox);
+ }
if (option (OPTCRYPTPROTHDRSWRITE))
{
&& (msg->security & APPLICATION_SMIME)
&& (msg->security & APPLICATION_PGP))
{
- /* here comes the draft ;-) */
+ /* here comes the draft ;-) */
}
}
b = b->parts;
if (!b || b->type != TYPETEXT ||
!b->subtype || ascii_strcasecmp (b->subtype, "plain") ||
- b->length != 0)
+ b->length != 0)
return 0;
b = b->next;
if (((p = mutt_get_parameter ("x-mutt-action", m->parameter))
|| (p = mutt_get_parameter ("x-action", m->parameter))
|| (p = mutt_get_parameter ("action", m->parameter)))
- && !ascii_strncasecmp ("pgp-sign", p, 8))
+ && !ascii_strncasecmp ("pgp-sign", p, 8))
t |= PGPSIGN;
else if (p && !ascii_strncasecmp ("pgp-encrypt", p, 11))
t |= PGPENCRYPT;
{
len++;
if (!ascii_strcasecmp ((t+len), "p7m"))
- /* Not sure if this is the correct thing to do, but
- it's required for compatibility with Outlook */
- return (SMIMESIGN|SMIMEOPAQUE);
+ /* Not sure if this is the correct thing to do, but
+ it's required for compatibility with Outlook */
+ return (SMIMESIGN|SMIMEOPAQUE);
else if (!ascii_strcasecmp ((t+len), "p7s"))
return (SMIMESIGN|SMIMEOPAQUE);
}
if (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)
- tmp = mutt_expand_aliases (Context->hdrs[Context->v2r[i]]
- ->env->sender);
+ tmp = mutt_expand_aliases (Context->hdrs[Context->v2r[i]]->env->sender);
mbox = tmp ? tmp->mailbox : NULL;
if (mbox)
{
&& (h->security & APPLICATION_SMIME))
{
if (h->security & ENCRYPT)
- mutt_copy_message (fpout, Context, h, MUTT_CM_NOHEADER
- |MUTT_CM_DECODE_CRYPT
- |MUTT_CM_DECODE_SMIME, 0);
+ mutt_copy_message (fpout, Context, h,
+ MUTT_CM_NOHEADER | MUTT_CM_DECODE_CRYPT | MUTT_CM_DECODE_SMIME,
+ 0);
else
mutt_copy_message (fpout, Context, h, 0, 0);
if (oppenc_mode || (msg->security & ENCRYPT))
{
- if ((WithCrypto & APPLICATION_PGP)
- && (msg->security & APPLICATION_PGP))
- {
- if ((*keylist = crypt_pgp_findkeys (adrlist, oppenc_mode)) == NULL)
- {
- rfc822_free_address (&adrlist);
- return (-1);
- }
- unset_option (OPTPGPCHECKTRUST);
- if (option (OPTPGPSELFENCRYPT))
- self_encrypt = PgpDefaultKey;
- }
- if ((WithCrypto & APPLICATION_SMIME)
- && (msg->security & APPLICATION_SMIME))
- {
- if ((*keylist = crypt_smime_findkeys (adrlist, oppenc_mode)) == NULL)
- {
- rfc822_free_address (&adrlist);
- return (-1);
- }
- if (option (OPTSMIMESELFENCRYPT))
- self_encrypt = SmimeDefaultKey;
- }
+ if ((WithCrypto & APPLICATION_PGP)
+ && (msg->security & APPLICATION_PGP))
+ {
+ if ((*keylist = crypt_pgp_findkeys (adrlist, oppenc_mode)) == NULL)
+ {
+ rfc822_free_address (&adrlist);
+ return (-1);
+ }
+ unset_option (OPTPGPCHECKTRUST);
+ if (option (OPTPGPSELFENCRYPT))
+ self_encrypt = PgpDefaultKey;
+ }
+ if ((WithCrypto & APPLICATION_SMIME)
+ && (msg->security & APPLICATION_SMIME))
+ {
+ if ((*keylist = crypt_smime_findkeys (adrlist, oppenc_mode)) == NULL)
+ {
+ rfc822_free_address (&adrlist);
+ return (-1);
+ }
+ if (option (OPTSMIMESELFENCRYPT))
+ self_encrypt = SmimeDefaultKey;
+ }
}
if (!oppenc_mode && self_encrypt && *self_encrypt)
state_printf (s, _("[-- Warning: "
"We can't verify %s/%s signatures. --]\n\n"),
- TYPE(signatures[i]), signatures[i]->subtype);
+ TYPE(signatures[i]), signatures[i]->subtype);
}
}
* See mutt_crypt.h for details.
*/
const char* crypt_get_fingerprint_or_id (char *p, const char **pphint,
- const char **ppl, const char **pps)
+ const char **ppl, const char **pps)
{
const char *ps, *pl, *phint;
char *pfcopy, *pf, *s1, *s2;
*/
/*
- This file dispatches the generic crypto functions to the
- implemented backend or provides dummy stubs. Note, that some
- generic functions are handled in crypt.c.
+ This file dispatches the generic crypto functions to the
+ implemented backend or provides dummy stubs. Note, that some
+ generic functions are handled in crypt.c.
*/
/* Note: This file has been changed to make use of the new module
/*
- Generic
+ Generic
*/
#endif
if (option (OPTCRYPTUSEGPGME))
- {
+ {
#ifdef CRYPT_BACKEND_GPGME
- crypto_module_register (&crypt_mod_pgp_gpgme);
- crypto_module_register (&crypt_mod_smime_gpgme);
+ crypto_module_register (&crypt_mod_pgp_gpgme);
+ crypto_module_register (&crypt_mod_smime_gpgme);
#else
- mutt_message (_("\"crypt_use_gpgme\" set"
- " but not built with GPGME support."));
- if (mutt_any_key_to_continue (NULL) == -1)
- mutt_exit(1);
+ mutt_message (_("\"crypt_use_gpgme\" set"
+ " but not built with GPGME support."));
+ if (mutt_any_key_to_continue (NULL) == -1)
+ mutt_exit(1);
#endif
- }
+ }
#if defined CRYPT_BACKEND_CLASSIC_PGP || defined CRYPT_BACKEND_CLASSIC_SMIME || defined CRYPT_BACKEND_GPGME
if (CRYPT_MOD_CALL_CHECK (PGP, init))
\f
/*
- PGP
+ PGP
*/
/*
- S/MIME
+ S/MIME
*/
answer[1] = 0;
reyes_ok = (expr = nl_langinfo (YESEXPR)) && expr[0] == '^' &&
- !REGCOMP (&reyes, expr, REG_NOSUB);
+ !REGCOMP (&reyes, expr, REG_NOSUB);
reno_ok = (expr = nl_langinfo (NOEXPR)) && expr[0] == '^' &&
- !REGCOMP (&reno, expr, REG_NOSUB);
+ !REGCOMP (&reno, expr, REG_NOSUB);
#endif
/*
/* if timestamp is 0 no time-based suppression is done */
if (TimeInc)
progress->timestamp = ((unsigned int) tv.tv_sec * 1000)
- + (unsigned int) (tv.tv_usec / 1000);
+ + (unsigned int) (tv.tv_usec / 1000);
mutt_progress_update (progress, 0, 0);
}
/* skip refresh if not enough time has passed */
if (update && progress->timestamp && !gettimeofday (&tv, NULL)) {
now = ((unsigned int) tv.tv_sec * 1000)
- + (unsigned int) (tv.tv_usec / 1000);
+ + (unsigned int) (tv.tv_usec / 1000);
if (now && now - progress->timestamp < TimeInc)
update = 0;
}
{
mutt_message ("%s %s/%s (%d%%)", progress->msg, posstr, progress->sizestr,
percent > 0 ? percent :
- (int) (100.0 * (double) progress->pos / progress->size));
+ (int) (100.0 * (double) progress->pos / progress->size));
}
else
{
char *p = strerror (errno);
dprint (1, (debugfile, "%s: %s (errno = %d)\n", s,
- p ? p : "unknown error", errno));
+ p ? p : "unknown error", errno));
mutt_error ("%s: %s (errno = %d)", s, p ? p : _("unknown error"), errno);
}
wc = ' ';
else
#endif
- if (!IsWPrint (wc))
- wc = '?';
+ if (!IsWPrint (wc))
+ wc = '?';
w = wcwidth (wc);
}
if (w >= 0)
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.");
-#define CHECK_IN_MAILBOX if (!Context) \
- { \
- mutt_flushinp (); \
- mutt_error _(No_mailbox_is_open); \
- break; \
- }
-
-#define CHECK_MSGCOUNT if (!Context) \
- { \
- mutt_flushinp (); \
- mutt_error _(No_mailbox_is_open); \
- break; \
- } \
- else if (!Context->msgcount) \
- { \
- mutt_flushinp (); \
- mutt_error _(There_are_no_messages); \
- break; \
- }
-
-#define CHECK_VISIBLE if (Context && menu->current >= Context->vcount) \
- {\
- mutt_flushinp (); \
- mutt_error _(No_visible); \
- break; \
- }
-
-
-#define CHECK_READONLY if (Context->readonly) \
- { \
- mutt_flushinp (); \
- mutt_error _(Mailbox_is_read_only); \
- break; \
- }
-
-#define CHECK_ACL(aclbit,action) \
- if (!mutt_bit_isset(Context->rights,aclbit)) { \
- mutt_flushinp(); \
- /* L10N: %s is one of the CHECK_ACL entries below. */ \
- mutt_error (_("%s: Operation not permitted by ACL"), action); \
- break; \
- }
+#define CHECK_IN_MAILBOX \
+ if (!Context) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(No_mailbox_is_open); \
+ break; \
+ }
+
+#define CHECK_MSGCOUNT \
+ if (!Context) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(No_mailbox_is_open); \
+ break; \
+ } \
+ else if (!Context->msgcount) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(There_are_no_messages); \
+ break; \
+ }
+
+#define CHECK_VISIBLE \
+ if (Context && menu->current >= Context->vcount) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(No_visible); \
+ break; \
+ }
-#define CHECK_ATTACH if(option(OPTATTACHMSG)) \
- {\
- mutt_flushinp (); \
- mutt_error _(Function_not_permitted_in_attach_message_mode); \
- break; \
- }
+
+#define CHECK_READONLY \
+ if (Context->readonly) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(Mailbox_is_read_only); \
+ break; \
+ }
+
+#define CHECK_ACL(aclbit,action) \
+ if (!mutt_bit_isset(Context->rights,aclbit)) \
+ { \
+ mutt_flushinp(); \
+ /* L10N: %s is one of the CHECK_ACL entries below. */ \
+ mutt_error (_("%s: Operation not permitted by ACL"), action); \
+ break; \
+ }
+
+#define CHECK_ATTACH \
+ if (option(OPTATTACHMSG)) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(Function_not_permitted_in_attach_message_mode); \
+ break; \
+ }
#define CURHDR Context->hdrs[Context->v2r[menu->current]]
#define OLDHDR Context->hdrs[Context->v2r[menu->oldcurrent]]
ctx->hdrs[j]->limited = 1;
ctx->vcount++;
ctx->vsize += this_body->length + this_body->offset -
- this_body->hdr_offset + padding;
+ this_body->hdr_offset + padding;
}
}
}
if (!attach_msg)
{
- /* check for new mail in the incoming folders */
- oldcount = newcount;
- if ((newcount = mutt_buffy_check (0)) != oldcount)
- menu->redraw |= REDRAW_STATUS;
- if (do_buffy_notify)
- {
- if (mutt_buffy_notify())
- {
- menu->redraw |= REDRAW_STATUS;
- if (option (OPTBEEPNEW))
- beep();
- if (NewMailCmd)
- {
- char cmd[LONG_STRING];
- menu_status_line(cmd, sizeof(cmd), menu, NONULL(NewMailCmd));
- mutt_system(cmd);
- }
- }
- }
- else
- do_buffy_notify = 1;
+ /* check for new mail in the incoming folders */
+ oldcount = newcount;
+ if ((newcount = mutt_buffy_check (0)) != oldcount)
+ menu->redraw |= REDRAW_STATUS;
+ if (do_buffy_notify)
+ {
+ if (mutt_buffy_notify())
+ {
+ menu->redraw |= REDRAW_STATUS;
+ if (option (OPTBEEPNEW))
+ beep();
+ if (NewMailCmd)
+ {
+ char cmd[LONG_STRING];
+ menu_status_line(cmd, sizeof(cmd), menu, NONULL(NewMailCmd));
+ mutt_system(cmd);
+ }
+ }
+ }
+ else
+ do_buffy_notify = 1;
}
if (op >= 0)
continue;
}
else
- menu->redraw = REDRAW_MOTION;
+ menu->redraw = REDRAW_MOTION;
}
else
mutt_error _("That message is not visible.");
case OP_MAIN_SHOW_LIMIT:
CHECK_IN_MAILBOX;
if (!Context->pattern)
- mutt_message _("No limit pattern is in effect.");
+ mutt_message _("No limit pattern is in effect.");
else
{
- char buf[STRING];
- /* L10N: ask for a limit to apply */
- snprintf (buf, sizeof(buf), _("Limit: %s"),Context->pattern);
- mutt_message ("%s", buf);
+ char buf[STRING];
+ /* L10N: ask for a limit to apply */
+ snprintf (buf, sizeof(buf), _("Limit: %s"),Context->pattern);
+ mutt_message ("%s", buf);
}
break;
CHECK_IN_MAILBOX;
menu->oldcurrent = (Context->vcount && menu->current >= 0 && menu->current < Context->vcount) ?
- CURHDR->index : -1;
+ CURHDR->index : -1;
if (mutt_pattern_func (MUTT_LIMIT, _("Limit to messages matching: ")) == 0)
{
if (menu->oldcurrent >= 0)
close = op;
if (attach_msg)
{
- done = 1;
- break;
+ done = 1;
+ break;
}
if (query_quadoption (OPT_QUIT, _("Quit Mutt?")) == MUTT_YES)
new_last_folder = safe_strdup (Context->realpath);
else
#endif
- new_last_folder = safe_strdup (Context->path);
+ new_last_folder = safe_strdup (Context->path);
oldcount = Context ? Context->msgcount : 0;
if ((check = mx_close_mailbox (Context, &index_hint)) != 0)
close = op;
if (menu->menu == MENU_MAIN && attach_msg)
{
- done = 1;
- break;
+ done = 1;
+ break;
}
if ((menu->menu == MENU_MAIN)
(op == OP_DECODE_SAVE) || (op == OP_DECODE_COPY),
(op == OP_DECRYPT_SAVE) || (op == OP_DECRYPT_COPY) ||
0) == 0 &&
- (op == OP_SAVE || op == OP_DECODE_SAVE || op == OP_DECRYPT_SAVE)
- )
+ (op == OP_SAVE || op == OP_DECODE_SAVE || op == OP_DECRYPT_SAVE)
+ )
{
menu->redraw |= REDRAW_STATUS;
if (tag)
menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
- break;
+ break;
case OP_MAIN_COLLAPSE_ALL:
CHECK_MSGCOUNT;
tm->tm_mday += DaysPerMonth[tm->tm_mon] + isLeapYearFeb (tm);
}
while (tm->tm_mday > (DaysPerMonth[tm->tm_mon] +
- (nLeap = isLeapYearFeb (tm))))
+ (nLeap = isLeapYearFeb (tm))))
{
tm->tm_mday -= DaysPerMonth[tm->tm_mon] + nLeap;
if (tm->tm_mon < 11)
if ((p = strchr (buffer, '\n')) == NULL)
{
fprintf (stderr, "%s: Line %d too long. Ask a wizard to enlarge\n"
- "%s: my buffer size.\n", Progname, line, Progname);
+ "%s: my buffer size.\n", Progname, line, Progname);
exit (1);
}
else
char *dd = d;
if (Debug)
- fprintf (stderr, "%s: get_token called for `%s'.\n",
- Progname, s);
+ fprintf (stderr, "%s: get_token called for `%s'.\n",
+ Progname, s);
s = skip_ws (s);
char *machine;
char *human;
}
-types[] =
-{
- { "DT_NONE", "-none-" },
- { "DT_BOOL", "boolean" },
- { "DT_NUM", "number" },
- { "DT_LNUM", "number (long)" },
- { "DT_STR", "string" },
- { "DT_PATH", "path" },
- { "DT_QUAD", "quadoption" },
- { "DT_SORT", "sort order" },
- { "DT_RX", "regular expression" },
- { "DT_MAGIC", "folder magic" },
- { "DT_SYN", NULL },
- { "DT_ADDR", "e-mail address" },
- { "DT_MBCHARTBL", "string" },
- { NULL, NULL }
-};
+ types[] =
+ {
+ { "DT_NONE", "-none-" },
+ { "DT_BOOL", "boolean" },
+ { "DT_NUM", "number" },
+ { "DT_LNUM", "number (long)" },
+ { "DT_STR", "string" },
+ { "DT_PATH", "path" },
+ { "DT_QUAD", "quadoption" },
+ { "DT_SORT", "sort order" },
+ { "DT_RX", "regular expression" },
+ { "DT_MAGIC", "folder magic" },
+ { "DT_SYN", NULL },
+ { "DT_ADDR", "e-mail address" },
+ { "DT_MBCHARTBL", "string" },
+ { NULL, NULL }
+ };
static int buff2type (const char *s)
for (type = DT_NONE; types[type].machine; type++)
if (!strcmp (types[type].machine, s))
- return type;
+ return type;
fprintf (stderr, "%s: Unknown type %s. Please update makedoc.c\n",
Progname, s);
{
switch (OutputFormat)
{
- case F_CONF:
- case F_MAN:
- if (output_dollar)
- putc ('$', out);
- fputs (ref, out);
- break;
-
- case F_SGML:
- fputs ("<link linkend=\"", out);
- sgml_id_fputs (ref, out);
- fputs ("\">", out);
- if (output_dollar)
- fputc ('$', out);
- sgml_fputs (ref, out);
- fputs ("</link>", out);
- break;
-
- default:
- break;
+ case F_CONF:
+ case F_MAN:
+ if (output_dollar)
+ putc ('$', out);
+ fputs (ref, out);
+ break;
+
+ case F_SGML:
+ fputs ("<link linkend=\"", out);
+ sgml_id_fputs (ref, out);
+ fputs ("\">", out);
+ if (output_dollar)
+ fputc ('$', out);
+ sgml_fputs (ref, out);
+ fputs ("</link>", out);
+ break;
+
+ default:
+ break;
}
}
{
fprintf (stderr, "dotlock [Mutt %s (%s)]\n", MUTT_VERSION, ReleaseDate);
fprintf (stderr, "usage: %s [-t|-f|-u|-d] [-p] [-r <retries>] file\n",
- av0);
+ av0);
fputs ("\noptions:"
- "\n -t\t\ttry"
- "\n -f\t\tforce"
- "\n -u\t\tunlock"
- "\n -d\t\tunlink"
- "\n -p\t\tprivileged"
+ "\n -t\t\ttry"
+ "\n -f\t\tforce"
+ "\n -u\t\tunlock"
+ "\n -d\t\tunlink"
+ "\n -p\t\tprivileged"
#ifndef USE_SETGID
- " (ignored)"
+ " (ignored)"
#endif
- "\n -r <retries>\tRetry locking"
- "\n", stderr);
+ "\n -r <retries>\tRetry locking"
+ "\n", stderr);
exit (DL_EX_ERROR);
}
return -1;
if ((lsb->st_dev != fsb->st_dev) ||
- (lsb->st_ino != fsb->st_ino) ||
- (lsb->st_mode != fsb->st_mode) ||
- (lsb->st_nlink != fsb->st_nlink) ||
- (lsb->st_uid != fsb->st_uid) ||
- (lsb->st_gid != fsb->st_gid) ||
- (lsb->st_rdev != fsb->st_rdev) ||
- (lsb->st_size != fsb->st_size))
+ (lsb->st_ino != fsb->st_ino) ||
+ (lsb->st_mode != fsb->st_mode) ||
+ (lsb->st_nlink != fsb->st_nlink) ||
+ (lsb->st_uid != fsb->st_uid) ||
+ (lsb->st_gid != fsb->st_gid) ||
+ (lsb->st_rdev != fsb->st_rdev) ||
+ (lsb->st_size != fsb->st_size))
{
/* something's fishy */
return -1;
time_t t;
snprintf (nfslockfile, sizeof (nfslockfile), "%s.%s.%d",
- realpath, Hostname, (int) getpid ());
+ realpath, Hostname, (int) getpid ());
snprintf (lockfile, sizeof (lockfile), "%s.lock", realpath);
int i;
snprintf (lockfile, sizeof (lockfile), "%s.lock",
- realpath);
+ realpath);
BEGIN_PRIVILEGED ();
i = unlink (lockfile);
/* include the current message */
p = tmp + mutt_strlen (tmp) + 1;
snprintf (tmp + mutt_strlen (tmp), sizeof (tmp) - mutt_strlen (tmp), " %d",
- cur->msgno + 1);
+ cur->msgno + 1);
}
buf = be_include_messages (p, buf, &bufmax, &buflen,
(ascii_tolower (tmp[1]) == 'm'),
}
rc = mutt_append_message (&tmpctx, ctx, cur, 0, CH_NOLEN |
- ((ctx->magic == MUTT_MBOX || ctx->magic == MUTT_MMDF) ? 0 : CH_NOSTATUS));
+ ((ctx->magic == MUTT_MBOX || ctx->magic == MUTT_MMDF) ? 0 : CH_NOSTATUS));
oerrno = errno;
mx_close_mailbox (&tmpctx, NULL);
mx_close_mailbox (&tmpctx, NULL);
- bail:
+bail:
if (fp) safe_fclose (&fp);
if (rc >= 0)
{
memset (&st, 0, sizeof (st));
for (; (k = mbrtowc (&wc, buf, MB_LEN_MAX, &st)) &&
- k != (size_t)(-1) && k != (size_t)(-2); buf += k)
+ k != (size_t)(-1) && k != (size_t)(-2); buf += k)
{
if (i >= wbuflen)
{
}
mutt_window_clrtoeol (MuttMessageWindow);
mutt_window_move (MuttMessageWindow, 0,
- col + my_wcswidth (state->wbuf + state->begin, state->curpos - state->begin));
+ col + my_wcswidth (state->wbuf + state->begin, state->curpos - state->begin));
}
mutt_refresh ();
else if (flags & MUTT_ALIAS && ch == OP_EDITOR_COMPLETE)
{
/* invoke the alias-menu to get more addresses */
- for (i = state->curpos; i && state->wbuf[i-1] != ',' &&
- state->wbuf[i-1] != ':'; i--)
+ for (i = state->curpos;
+ i && state->wbuf[i-1] != ',' && state->wbuf[i-1] != ':';
+ i--)
;
for (; i < state->lastchar && state->wbuf[i] == ' '; i++)
;
}
else if (flags & MUTT_LABEL && ch == OP_EDITOR_COMPLETE)
{
- for (i = state->curpos; i && state->wbuf[i-1] != ',' &&
- state->wbuf[i-1] != ':'; i--)
+ for (i = state->curpos;
+ i && state->wbuf[i-1] != ',' && state->wbuf[i-1] != ':';
+ i--)
;
for (; i < state->lastchar && state->wbuf[i] == ' '; i++)
;
my_wcstombs (buf, buflen, state->wbuf, state->curpos);
/* see if the path has changed from the last time */
- if ((!tempbuf && !state->lastchar) || (tempbuf && templen == state->lastchar &&
- !memcmp (tempbuf, state->wbuf, state->lastchar * sizeof (wchar_t))))
+ if ((!tempbuf && !state->lastchar) ||
+ (tempbuf && templen == state->lastchar &&
+ !memcmp (tempbuf, state->wbuf, state->lastchar * sizeof (wchar_t))))
{
_mutt_select_file (buf, buflen,
((flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : 0) | (multiple ? MUTT_SEL_MULTI : 0),
break;
case OP_EDITOR_QUOTE_CHAR:
- {
- event_t event;
- /*ADDCH (LastKey);*/
- do
- {
- event = mutt_getch ();
- } while (event.ch == -2);
- if (event.ch >= 0)
- {
- LastKey = event.ch;
- goto self_insert;
- }
- }
+ {
+ event_t event;
+ /*ADDCH (LastKey);*/
+ do
+ {
+ event = mutt_getch ();
+ } while (event.ch == -2);
+ if (event.ch >= 0)
+ {
+ LastKey = event.ch;
+ goto self_insert;
+ }
+ }
case OP_EDITOR_TRANSPOSE_CHARS:
if (state->lastchar < 2)
BEEP ();
else
- {
+ {
wchar_t t;
if (state->curpos == 0)
}
}
- bye:
+bye:
mutt_reset_history_state (hclass);
FREE (&tempbuf);
dprint (2, (debugfile, "capabilities info: %s\n", p));
while(*p)
- {
- switch(*p++)
- {
- case 'D':
- flags |= KEYFLAG_DISABLED;
- break;
-
- case 'e':
- flags |= KEYFLAG_CANENCRYPT;
- break;
-
- case 's':
- flags |= KEYFLAG_CANSIGN;
- break;
- }
- }
+ {
+ switch(*p++)
+ {
+ case 'D':
+ flags |= KEYFLAG_DISABLED;
+ break;
+
+ case 'e':
+ flags |= KEYFLAG_CANENCRYPT;
+ break;
+
+ case 's':
+ flags |= KEYFLAG_CANSIGN;
+ break;
+ }
+ }
if (!is_uid &&
(!*is_subkey || !option (OPTPGPIGNORESUB)
typedef int (*handler_t) (BODY *, STATE *);
const int Index_hex[128] = {
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1, -1,-1,-1,-1,
- -1,10,11,12, 13,14,15,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,10,11,12, 13,14,15,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,-1,-1, -1,-1,-1,-1,
+ -1,10,11,12, 13,14,15,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,10,11,12, 13,14,15,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1
};
const int Index_64[128] = {
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
+ 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
+ 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
+ -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+ 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
};
static void state_prefix_put (const char *d, size_t dlen, STATE *s)
if (last == '\n')
{
while (linelen > 0 && ISSPACE (line[linelen-1]))
- linelen--;
+ linelen--;
line[linelen]=0;
}
/* "i" may be zero if there is trailing whitespace, which is not an error */
if (i != 0)
dprint (2, (debugfile, "%s:%d [mutt_decode_base64()]: "
- "didn't get a multiple of 4 chars.\n", __FILE__, __LINE__));
+ "didn't get a multiple of 4 chars.\n", __FILE__, __LINE__));
break;
}
#define IndentSize (4)
enum { RICH_PARAM=0, RICH_BOLD, RICH_UNDERLINE, RICH_ITALIC, RICH_NOFILL,
- RICH_INDENT, RICH_INDENT_RIGHT, RICH_EXCERPT, RICH_CENTER, RICH_FLUSHLEFT,
- RICH_FLUSHRIGHT, RICH_COLOR, RICH_LAST_TAG };
+ RICH_INDENT, RICH_INDENT_RIGHT, RICH_EXCERPT, RICH_CENTER, RICH_FLUSHLEFT,
+ RICH_FLUSHRIGHT, RICH_COLOR, RICH_LAST_TAG };
static const struct {
const wchar_t *tag_name;
if (stte->s->prefix)
{
state_puts (stte->s->prefix, stte->s);
- stte->indent_len += mutt_strlen (stte->s->prefix);
+ stte->indent_len += mutt_strlen (stte->s->prefix);
}
else
{
for (; t; t = t->next) {
int i = mutt_strlen (t->data) - 1;
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)
is_autoview = 1;
}
b = mutt_new_body ();
b->length = (long) st.st_size;
b->parts = mutt_parse_multipart (s->fpin,
- mutt_get_parameter ("boundary", a->parameter),
- (long) st.st_size, ascii_strcasecmp ("digest", a->subtype) == 0);
+ mutt_get_parameter ("boundary", a->parameter),
+ (long) st.st_size,
+ ascii_strcasecmp ("digest", a->subtype) == 0);
}
else
b = a;
b = mutt_new_body ();
b->length = (long) st.st_size;
b->parts = mutt_parse_multipart (s->fpin,
- mutt_get_parameter ("boundary", a->parameter),
- (long) st.st_size, ascii_strcasecmp ("digest", a->subtype) == 0);
+ mutt_get_parameter ("boundary", a->parameter),
+ (long) st.st_size,
+ ascii_strcasecmp ("digest", a->subtype) == 0);
}
else
b = a;
state_mark_attach (s);
state_printf (s, _("[-- This %s/%s attachment "),
- TYPE(b->parts), b->parts->subtype);
+ TYPE(b->parts), b->parts->subtype);
length = mutt_get_parameter ("length", b->parameter);
if (length)
{
if (b->encoding == ENCBASE64 || b->encoding == ENCQUOTEDPRINTABLE ||
b->encoding == ENCUUENCODED || plaintext ||
mutt_is_text_part (b)) /* text subtypes may
- * require character
- * set conversion even
- * with 8bit encoding.
- */
+ * require character
+ * set conversion even
+ * with 8bit encoding.
+ */
{
origType = b->type;
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 = 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.
+ */
savePrefix = s->prefix;
s->prefix = NULL;
displaying from the attachment menu (i.e. pager) */
if ((!option (OPTHONORDISP) || (b->disposition != DISPATTACH ||
option(OPTVIEWATTACH))) &&
- (plaintext || handler))
+ (plaintext || handler))
{
rc = run_decode_and_handler (b, s, handler, plaintext);
}
/* print hint to use attachment menu for disposition == attachment
if we're not already being called from there */
else if ((s->flags & MUTT_DISPLAY) || (b->disposition == DISPATTACH &&
- !option (OPTVIEWATTACH) &&
- option (OPTHONORDISP) &&
- (plaintext || handler)))
+ !option (OPTVIEWATTACH) &&
+ option (OPTHONORDISP) &&
+ (plaintext || handler)))
{
state_mark_attach (s);
if (option (OPTHONORDISP) && b->disposition == DISPATTACH)
char keystroke[SHORT_STRING];
if (km_expand_key (keystroke, sizeof(keystroke),
- km_find_func (MENU_PAGER, OP_VIEW_ATTACHMENTS)))
+ km_find_func (MENU_PAGER, OP_VIEW_ATTACHMENTS)))
fprintf (s->fpout, _("(use '%s' to view this part)"), keystroke);
else
fputs (_("(need 'view-attachments' bound to key!)"), s->fpout);
}
static void union_hash_delete (HASH *table, union hash_key key, const void *data,
- void (*destroy) (void *))
+ void (*destroy) (void *))
{
int hash;
struct hash_elem *ptr, **last;
}
void int_hash_delete (HASH *table, unsigned int intkey, const void *data,
- void (*destroy) (void *))
+ void (*destroy) (void *))
{
union hash_key key;
key.intkey = intkey;
void hash_delete (HASH * table, const char *key, const void *data,
void (*destroy) (void *));
void int_hash_delete (HASH * table, unsigned int key, const void *data,
- void (*destroy) (void *));
+ void (*destroy) (void *));
void hash_destroy (HASH ** hash, void (*destroy) (void *));
int ret, plen;
#ifndef HAVE_ICONV
const char *chs = Charset && *Charset ? Charset :
- mutt_get_default_charset ();
+ mutt_get_default_charset ();
#endif
plen = mutt_strlen (path);
md5sum[9], md5sum[10], md5sum[11], md5sum[12],
md5sum[13], md5sum[14], md5sum[15]
,chs
- );
+ );
#else
ret = snprintf(hcpath, _POSIX_PATH_MAX,
"%s/%02x%02x%02x%02x%02x%02x%02x%02x"
md5sum[4], md5sum[5], md5sum[6], md5sum[7], md5sum[8],
md5sum[9], md5sum[10], md5sum[11], md5sum[12],
md5sum[13], md5sum[14], md5sum[15]
- );
+ );
#endif
}
{
h->db = tcbdbnew();
if (!h->db)
- return -1;
+ return -1;
if (option(OPTHCACHECOMPRESS))
tcbdbtune(h->db, 0, 0, 0, -1, -1, BDBTDEFLATE);
if (tcbdbopen(h->db, path, BDBOWRITER | BDBOCREAT))
option(OPTHCACHECOMPRESS) ? "#opts=c" : "");
h->db = kcdbnew();
if (!h->db)
- return -1;
+ return -1;
if (kcdbopen(h->db, fullpath, KCOWRITER | KCOCREATE))
return 0;
else
goto fail_unlock;
ret = (*h->env->open)(h->env, NULL, DB_INIT_MPOOL | DB_CREATE | DB_PRIVATE,
- 0600);
+ 0600);
if (ret)
goto fail_env;
return 0;
- fail_db:
+fail_db:
h->db->close (h->db, 0);
- fail_env:
+fail_env:
h->env->close (h->env, 0);
- fail_unlock:
+fail_unlock:
mx_unlock_file (h->lockfile, h->fd, 0);
- fail_close:
+fail_close:
close (h->fd);
unlink (h->lockfile);
typedef int (*hcache_namer_t)(const char* path, char* dest, size_t dlen);
header_cache_t *mutt_hcache_open(const char *path, const char *folder,
- hcache_namer_t namer);
+ hcache_namer_t namer);
void mutt_hcache_close(header_cache_t *h);
HEADER *mutt_hcache_restore(const unsigned char *d, HEADER **oh);
void *mutt_hcache_fetch(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn));
case '(':
case '<':
- /* preprocess $date_format to handle %Z */
- {
- const char *cp;
- struct tm *tm;
- time_t T;
-
- p = dest;
-
- cp = (op == 'd' || op == 'D') ? (NONULL (DateFmt)) : src;
- if (*cp == '!')
- {
- do_locales = 0;
- cp++;
- }
- else
- do_locales = 1;
-
- len = destlen - 1;
- while (len > 0 && (((op == 'd' || op == 'D') && *cp) ||
- (op == '{' && *cp != '}') ||
- (op == '[' && *cp != ']') ||
- (op == '(' && *cp != ')') ||
- (op == '<' && *cp != '>')))
- {
- if (*cp == '%')
- {
- cp++;
- if ((*cp == 'Z' || *cp == 'z') && (op == 'd' || op == '{'))
- {
- if (len >= 5)
- {
- sprintf (p, "%c%02u%02u", hdr->zoccident ? '-' : '+',
- hdr->zhours, hdr->zminutes);
- p += 5;
- len -= 5;
- }
- else
- break; /* not enough space left */
- }
- else
- {
- if (len >= 2)
- {
- *p++ = '%';
- *p++ = *cp;
- len -= 2;
- }
- else
- break; /* not enough space */
- }
- cp++;
- }
- else
- {
- *p++ = *cp++;
- len--;
- }
- }
- *p = 0;
+ /* preprocess $date_format to handle %Z */
+ {
+ const char *cp;
+ struct tm *tm;
+ time_t T;
- if (op == '[' || op == 'D')
- tm = localtime (&hdr->date_sent);
- else if (op == '(')
- tm = localtime (&hdr->received);
- else if (op == '<')
- {
- T = time (NULL);
- tm = localtime (&T);
- }
- else
- {
- /* restore sender's time zone */
- T = hdr->date_sent;
- if (hdr->zoccident)
- T -= (hdr->zhours * 3600 + hdr->zminutes * 60);
- else
- T += (hdr->zhours * 3600 + hdr->zminutes * 60);
- tm = gmtime (&T);
- }
-
- if (!do_locales)
- setlocale (LC_TIME, "C");
- strftime (buf2, sizeof (buf2), dest, tm);
- if (!do_locales)
- setlocale (LC_TIME, "");
+ p = dest;
- mutt_format_s (dest, destlen, prefix, buf2);
- if (len > 0 && op != 'd' && op != 'D') /* Skip ending op */
- src = cp + 1;
+ cp = (op == 'd' || op == 'D') ? (NONULL (DateFmt)) : src;
+ if (*cp == '!')
+ {
+ do_locales = 0;
+ cp++;
}
- break;
+ else
+ do_locales = 1;
+
+ len = destlen - 1;
+ while (len > 0 && (((op == 'd' || op == 'D') && *cp) ||
+ (op == '{' && *cp != '}') ||
+ (op == '[' && *cp != ']') ||
+ (op == '(' && *cp != ')') ||
+ (op == '<' && *cp != '>')))
+ {
+ if (*cp == '%')
+ {
+ cp++;
+ if ((*cp == 'Z' || *cp == 'z') && (op == 'd' || op == '{'))
+ {
+ if (len >= 5)
+ {
+ sprintf (p, "%c%02u%02u", hdr->zoccident ? '-' : '+',
+ hdr->zhours, hdr->zminutes);
+ p += 5;
+ len -= 5;
+ }
+ else
+ break; /* not enough space left */
+ }
+ else
+ {
+ if (len >= 2)
+ {
+ *p++ = '%';
+ *p++ = *cp;
+ len -= 2;
+ }
+ else
+ break; /* not enough space */
+ }
+ cp++;
+ }
+ else
+ {
+ *p++ = *cp++;
+ len--;
+ }
+ }
+ *p = 0;
+
+ if (op == '[' || op == 'D')
+ tm = localtime (&hdr->date_sent);
+ else if (op == '(')
+ tm = localtime (&hdr->received);
+ else if (op == '<')
+ {
+ T = time (NULL);
+ tm = localtime (&T);
+ }
+ else
+ {
+ /* restore sender's time zone */
+ T = hdr->date_sent;
+ if (hdr->zoccident)
+ T -= (hdr->zhours * 3600 + hdr->zminutes * 60);
+ else
+ T += (hdr->zhours * 3600 + hdr->zminutes * 60);
+ tm = gmtime (&T);
+ }
+
+ if (!do_locales)
+ setlocale (LC_TIME, "C");
+ strftime (buf2, sizeof (buf2), dest, tm);
+ if (!do_locales)
+ setlocale (LC_TIME, "");
+
+ mutt_format_s (dest, destlen, prefix, buf2);
+ if (len > 0 && op != 'd' && op != 'D') /* Skip ending op */
+ src = cp + 1;
+ }
+ break;
case 'e':
snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
case 'H':
/* (Hormel) spam score */
if (optional)
+ {
optional = hdr->env->spam ? 1 : 0;
+ }
- if (hdr->env->spam)
- mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->spam->data));
- else
- mutt_format_s (dest, destlen, prefix, "");
+ if (hdr->env->spam)
+ mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->spam->data));
+ else
+ mutt_format_s (dest, destlen, prefix, "");
break;
break;
case 's':
+ {
+ char *subj;
+ if (hdr->env->disp_subj)
+ subj = hdr->env->disp_subj;
+ else if (SubjectRxList)
+ subj = apply_subject_mods(hdr->env);
+ else
+ subj = hdr->env->subject;
+ if (flags & MUTT_FORMAT_TREE && !hdr->collapsed)
{
- char *subj;
- if (hdr->env->disp_subj)
- subj = hdr->env->disp_subj;
- else if (SubjectRxList)
- subj = apply_subject_mods(hdr->env);
- else
- subj = hdr->env->subject;
- if (flags & MUTT_FORMAT_TREE && !hdr->collapsed)
- {
- if (flags & MUTT_FORMAT_FORCESUBJ)
- {
- mutt_format_s (dest, destlen, "", NONULL (subj));
- snprintf (buf2, sizeof (buf2), "%s%s", hdr->tree, dest);
- mutt_format_s_tree (dest, destlen, prefix, buf2);
- }
- else
- mutt_format_s_tree (dest, destlen, prefix, hdr->tree);
- }
- else
- mutt_format_s (dest, destlen, prefix, NONULL (subj));
+ if (flags & MUTT_FORMAT_FORCESUBJ)
+ {
+ mutt_format_s (dest, destlen, "", NONULL (subj));
+ snprintf (buf2, sizeof (buf2), "%s%s", hdr->tree, dest);
+ mutt_format_s_tree (dest, destlen, prefix, buf2);
+ }
+ else
+ mutt_format_s_tree (dest, destlen, prefix, hdr->tree);
}
- break;
+ else
+ mutt_format_s (dest, destlen, prefix, NONULL (subj));
+ }
+ break;
case 'S':
if (hdr->deleted)
break;
case 'X':
- {
- int count = mutt_count_body_parts (ctx, hdr);
+ {
+ int count = mutt_count_body_parts (ctx, hdr);
- /* The recursion allows messages without depth to return 0. */
- if (optional)
- optional = count != 0;
+ /* The recursion allows messages without depth to return 0. */
+ if (optional)
+ optional = count != 0;
- snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
- snprintf (dest, destlen, fmt, count);
- }
- break;
+ snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
+ snprintf (dest, destlen, fmt, count);
+ }
+ break;
- case 'y':
- if (optional)
- optional = hdr->env->x_label ? 1 : 0;
+ case 'y':
+ if (optional)
+ optional = hdr->env->x_label ? 1 : 0;
- mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->x_label));
- break;
+ mutt_format_s (dest, destlen, prefix, NONULL (hdr->env->x_label));
+ break;
case 'Y':
if (hdr->env->x_label)
if (label_message(Context, HDR_OF(i), new)) {
++changed;
mutt_set_flag(Context, HDR_OF(i),
- MUTT_TAG, 0);
+ MUTT_TAG, 0);
/* mutt_set_flag re-evals the header color */
}
}
{
b = help_lookupFunction (map->op, menu);
format_line (f, 0, buf, b ? b->name : "UNKNOWN",
- b ? _(HelpStrings[b->op]) : _("ERROR: please report this bug"));
+ b ? _(HelpStrings[b->op]) : _("ERROR: please report this bug"));
}
}
}
#endif
else if (DefaultHook && !(data & (MUTT_CHARSETHOOK | MUTT_ICONVHOOK | MUTT_ACCOUNTHOOK))
&& (!WithCrypto || !(data & MUTT_CRYPTHOOK))
- )
+ )
{
char tmp[HUGE_STRING];
if (data & (MUTT_SENDHOOK | MUTT_SEND2HOOK | MUTT_SAVEHOOK | MUTT_FCCHOOK | MUTT_MESSAGEHOOK | MUTT_REPLYHOOK))
{
if ((pat = mutt_pattern_comp (pattern.data,
- (data & (MUTT_SENDHOOK | MUTT_SEND2HOOK | MUTT_FCCHOOK)) ? 0 : MUTT_FULL_MSG,
+ (data & (MUTT_SENDHOOK | MUTT_SEND2HOOK | MUTT_FCCHOOK)) ? 0 : MUTT_FULL_MSG,
err)) == NULL)
goto error;
}
#ifdef MUTT_CRYPTHOOK
if ((rc = REGCOMP (rx, NONULL(pattern.data), ((data & (MUTT_CRYPTHOOK|MUTT_CHARSETHOOK|MUTT_ICONVHOOK)) ? REG_ICASE : 0))) != 0)
#else
- if ((rc = REGCOMP (rx, NONULL(pattern.data), (data & (MUTT_CHARSETHOOK|MUTT_ICONVHOOK)) ? REG_ICASE : 0)) != 0)
+ if ((rc = REGCOMP (rx, NONULL(pattern.data), (data & (MUTT_CHARSETHOOK|MUTT_ICONVHOOK)) ? REG_ICASE : 0)) != 0)
#endif /* MUTT_CRYPTHOOK */
- {
- regerror (rc, rx, err->data, err->dsize);
- FREE (&rx);
- goto error;
- }
+ {
+ regerror (rc, rx, err->data, err->dsize);
+ FREE (&rx);
+ goto error;
+ }
}
if (ptr)
if ((pat = mutt_pattern_comp (pattern->data,
MUTT_FULL_MSG | MUTT_PATTERN_DYNAMIC,
err)) == NULL)
- goto out;
+ goto out;
if (ptr)
{
if (!type)
{
snprintf (err->data, err->dsize,
- _("unhook: unknown hook type: %s"), buf->data);
+ _("unhook: unknown hook type: %s"), buf->data);
return (-1);
}
if (current_hook_type == type)
for (; tmp; tmp = tmp->next)
{
- if ((tmp->type & hook) && ((match &&
- regexec (tmp->rx.rx, match, 0, NULL, 0) == 0) ^ tmp->rx.not))
+ if ((tmp->type & hook) &&
+ ((match && regexec (tmp->rx.rx, match, 0, NULL, 0) == 0) ^ tmp->rx.not))
return (tmp->command);
}
return (NULL);
if (imap_code (idata->buf))
return IMAP_AUTH_SUCCESS;
- bail:
+bail:
mutt_error _("Anonymous authentication failed.");
mutt_sleep (2);
return IMAP_AUTH_FAILURE;
/* forward declarations */
static void hmac_md5 (const char* password, char* challenge,
- unsigned char* response);
+ unsigned char* response);
/* imap_auth_cram_md5: AUTH=CRAM-MD5 support. */
imap_auth_res_t imap_auth_cram_md5 (IMAP_DATA* idata, const char* method)
hmac_md5 (idata->conn->account.pass, obuf, hmac_response);
/* dubious optimisation I saw elsewhere: make the whole string in one call */
snprintf (obuf, sizeof (obuf),
- "%s %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
- idata->conn->account.user,
- hmac_response[0], hmac_response[1], hmac_response[2], hmac_response[3],
- hmac_response[4], hmac_response[5], hmac_response[6], hmac_response[7],
- hmac_response[8], hmac_response[9], hmac_response[10], hmac_response[11],
- hmac_response[12], hmac_response[13], hmac_response[14], hmac_response[15]);
+ "%s %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
+ idata->conn->account.user,
+ hmac_response[0], hmac_response[1], hmac_response[2], hmac_response[3],
+ hmac_response[4], hmac_response[5], hmac_response[6], hmac_response[7],
+ hmac_response[8], hmac_response[9], hmac_response[10], hmac_response[11],
+ hmac_response[12], hmac_response[13], hmac_response[14], hmac_response[15]);
dprint(2, (debugfile, "CRAM response: %s\n", obuf));
/* XXX - ibuf must be long enough to store the base64 encoding of obuf,
if (imap_code (idata->buf))
return IMAP_AUTH_SUCCESS;
- bail:
+bail:
mutt_error _("CRAM-MD5 authentication failed.");
mutt_sleep (2);
return IMAP_AUTH_FAILURE;
/* hmac_md5: produce CRAM-MD5 challenge response. */
static void hmac_md5 (const char* password, char* challenge,
- unsigned char* response)
+ unsigned char* response)
{
struct md5_ctx ctx;
unsigned char ipad[MD5_BLOCK_LEN], opad[MD5_BLOCK_LEN];
#define GSS_AUTH_P_PRIVACY 4
static void print_gss_error(OM_uint32 err_maj, OM_uint32 err_min)
{
- OM_uint32 maj_stat, min_stat;
- OM_uint32 msg_ctx = 0;
- gss_buffer_desc status_string;
- char buf_maj[512];
- char buf_min[512];
- size_t status_len;
-
- do
- {
- maj_stat = gss_display_status (&min_stat,
- err_maj,
- GSS_C_GSS_CODE,
- GSS_C_NO_OID,
- &msg_ctx,
- &status_string);
- if (GSS_ERROR(maj_stat))
- break;
- status_len = status_string.length;
- if (status_len >= sizeof(buf_maj))
- status_len = sizeof(buf_maj) - 1;
- strncpy(buf_maj, (char*) status_string.value, status_len);
- buf_maj[status_len] = '\0';
- gss_release_buffer(&min_stat, &status_string);
-
- maj_stat = gss_display_status (&min_stat,
- err_min,
- GSS_C_MECH_CODE,
- GSS_C_NULL_OID,
- &msg_ctx,
- &status_string);
- if (!GSS_ERROR(maj_stat))
- {
- status_len = status_string.length;
- if (status_len >= sizeof(buf_min))
- status_len = sizeof(buf_min) - 1;
- strncpy(buf_min, (char*) status_string.value, status_len);
- buf_min[status_len] = '\0';
- gss_release_buffer(&min_stat, &status_string);
- }
- } while (!GSS_ERROR(maj_stat) && msg_ctx != 0);
-
- dprint (2, (debugfile, "((%s:%d )(%s:%d))", buf_maj, err_maj, buf_min, err_min));
+ OM_uint32 maj_stat, min_stat;
+ OM_uint32 msg_ctx = 0;
+ gss_buffer_desc status_string;
+ char buf_maj[512];
+ char buf_min[512];
+ size_t status_len;
+
+ do
+ {
+ maj_stat = gss_display_status (&min_stat,
+ err_maj,
+ GSS_C_GSS_CODE,
+ GSS_C_NO_OID,
+ &msg_ctx,
+ &status_string);
+ if (GSS_ERROR(maj_stat))
+ break;
+ status_len = status_string.length;
+ if (status_len >= sizeof(buf_maj))
+ status_len = sizeof(buf_maj) - 1;
+ strncpy(buf_maj, (char*) status_string.value, status_len);
+ buf_maj[status_len] = '\0';
+ gss_release_buffer(&min_stat, &status_string);
+
+ maj_stat = gss_display_status (&min_stat,
+ err_min,
+ GSS_C_MECH_CODE,
+ GSS_C_NULL_OID,
+ &msg_ctx,
+ &status_string);
+ if (!GSS_ERROR(maj_stat))
+ {
+ status_len = status_string.length;
+ if (status_len >= sizeof(buf_min))
+ status_len = sizeof(buf_min) - 1;
+ strncpy(buf_min, (char*) status_string.value, status_len);
+ buf_min[status_len] = '\0';
+ gss_release_buffer(&min_stat, &status_string);
+ }
+ } while (!GSS_ERROR(maj_stat) && msg_ctx != 0);
+
+ dprint (2, (debugfile, "((%s:%d )(%s:%d))", buf_maj, err_maj, buf_min, err_min));
}
/* imap_auth_gss: AUTH=GSSAPI support. */
request_buf.value = buf1;
request_buf.length = strlen (buf1);
maj_stat = gss_import_name (&min_stat, &request_buf, gss_nt_service_name,
- &target_name);
+ &target_name);
if (maj_stat != GSS_S_COMPLETE)
{
dprint (2, (debugfile, "Couldn't get service name for [%s]\n", buf1));
else if (debuglevel >= 2)
{
maj_stat = gss_display_name (&min_stat, target_name, &request_buf,
- &mech_name);
+ &mech_name);
dprint (2, (debugfile, "Using service name [%s]\n",
- (char*) request_buf.value));
+ (char*) request_buf.value));
maj_stat = gss_release_buffer (&min_stat, &request_buf);
}
#endif
/* build token */
maj_stat = gss_init_sec_context (&min_stat, GSS_C_NO_CREDENTIAL, &context,
- target_name, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, 0,
- GSS_C_NO_CHANNEL_BINDINGS, sec_token, NULL, &send_token,
- (unsigned int*) &cflags, NULL);
+ target_name, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, 0,
+ GSS_C_NO_CHANNEL_BINDINGS, sec_token, NULL, &send_token,
+ (unsigned int*) &cflags, NULL);
if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED)
{
print_gss_error(maj_stat, min_stat);
/* now start the security context initialisation loop... */
dprint (2, (debugfile, "Sending credentials\n"));
mutt_to_base64 ((unsigned char*) buf1, send_token.value, send_token.length,
- sizeof (buf1) - 2);
+ sizeof (buf1) - 2);
gss_release_buffer (&min_stat, &send_token);
safe_strcat (buf1, sizeof (buf1), "\r\n");
mutt_socket_write (idata->conn, buf1);
/* Write client data */
maj_stat = gss_init_sec_context (&min_stat, GSS_C_NO_CREDENTIAL, &context,
- target_name, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, 0,
- GSS_C_NO_CHANNEL_BINDINGS, sec_token, NULL, &send_token,
- (unsigned int*) &cflags, NULL);
+ target_name, GSS_C_NO_OID, GSS_C_MUTUAL_FLAG | GSS_C_SEQUENCE_FLAG, 0,
+ GSS_C_NO_CHANNEL_BINDINGS, sec_token, NULL, &send_token,
+ (unsigned int*) &cflags, NULL);
if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CONTINUE_NEEDED)
{
print_gss_error(maj_stat, min_stat);
goto err_abort_cmd;
}
mutt_to_base64 ((unsigned char*) buf1, send_token.value,
- send_token.length, sizeof (buf1) - 2);
+ send_token.length, sizeof (buf1) - 2);
gss_release_buffer (&min_stat, &send_token);
safe_strcat (buf1, sizeof (buf1), "\r\n");
mutt_socket_write (idata->conn, buf1);
request_buf.value = buf2;
maj_stat = gss_unwrap (&min_stat, context, &request_buf, &send_token,
- &cflags, &quality);
+ &cflags, &quality);
if (maj_stat != GSS_S_COMPLETE)
{
print_gss_error(maj_stat, min_stat);
buf_size = ntohl (*((long *) send_token.value));
gss_release_buffer (&min_stat, &send_token);
dprint (2, (debugfile, "Unwrapped security level flags: %c%c%c\n",
- server_conf_flags & GSS_AUTH_P_NONE ? 'N' : '-',
- server_conf_flags & GSS_AUTH_P_INTEGRITY ? 'I' : '-',
- server_conf_flags & GSS_AUTH_P_PRIVACY ? 'P' : '-'));
+ server_conf_flags & GSS_AUTH_P_NONE ? 'N' : '-',
+ server_conf_flags & GSS_AUTH_P_INTEGRITY ? 'I' : '-',
+ server_conf_flags & GSS_AUTH_P_PRIVACY ? 'P' : '-'));
dprint (2, (debugfile, "Maximum GSS token size is %ld\n", buf_size));
/* agree to terms (hack!) */
request_buf.value = buf1;
request_buf.length = 4 + strlen (idata->conn->account.user);
maj_stat = gss_wrap (&min_stat, context, 0, GSS_C_QOP_DEFAULT, &request_buf,
- &cflags, &send_token);
+ &cflags, &send_token);
if (maj_stat != GSS_S_COMPLETE)
{
dprint (2, (debugfile, "Error creating login request\n"));
mutt_to_base64 ((unsigned char*) buf1, send_token.value, send_token.length,
sizeof (buf1) - 2);
dprint (2, (debugfile, "Requesting authorisation as %s\n",
- idata->conn->account.user));
+ idata->conn->account.user));
safe_strcat (buf1, sizeof (buf1), "\r\n");
mutt_socket_write (idata->conn, buf1);
else
goto bail;
- err_abort_cmd:
+err_abort_cmd:
mutt_socket_write (idata->conn, "*\r\n");
do
rc = imap_cmd_step (idata);
while (rc == IMAP_CMD_CONTINUE);
- bail:
+bail:
mutt_error _("GSSAPI authentication failed.");
mutt_sleep (2);
return IMAP_AUTH_FAILURE;
if (debuglevel < IMAP_LOG_PASS)
dprint (2, (debugfile, "Sending LOGIN command for %s...\n",
- idata->conn->account.user));
+ idata->conn->account.user));
#endif
snprintf (buf, sizeof (buf), "LOGIN %s %s", q_user, q_pass);
if (mutt_sasl_client_new (idata->conn, &saslconn) < 0)
{
dprint (1, (debugfile,
- "imap_auth_sasl: Error allocating SASL connection.\n"));
+ "imap_auth_sasl: Error allocating SASL connection.\n"));
return IMAP_AUTH_FAILURE;
}
rc = sasl_client_start (saslconn, "AUTH=ANONYMOUS", NULL, &pc, &olen,
&mech);
} else if (!ascii_strcasecmp ("login", method) &&
- !strstr (NONULL (idata->capstr), "AUTH=LOGIN")) {
+ !strstr (NONULL (idata->capstr), "AUTH=LOGIN")) {
/* do not use SASL login for regular IMAP login (#3556) */
sasl_dispose (&saslconn);
return IMAP_AUTH_UNAVAIL;
do
{
rc = sasl_client_start (saslconn, method, &interaction,
- &pc, &olen, &mech);
+ &pc, &olen, &mech);
if (rc == SASL_INTERACT)
mutt_sasl_interact (interaction);
}
return IMAP_AUTH_SUCCESS;
}
- bail:
+bail:
sasl_dispose (&saslconn);
FREE (&buf);
/* -- forward declarations -- */
static int browse_add_list_result (IMAP_DATA* idata, const char* cmd,
- struct browser_state* state, short isparent);
+ struct browser_state* state, short isparent);
static void imap_add_folder (char delim, char *folder, int noselect,
- int noinferiors, struct browser_state *state, short isparent);
+ int noinferiors, struct browser_state *state, short isparent);
static int compare_names(struct folder_file *a, struct folder_file *b);
/* imap_browse: IMAP hook into the folder browser, fills out browser_state,
FREE (&mx.mbox);
return 0;
- fail:
+fail:
if (save_lsub)
set_option (OPTIMAPCHECKSUBSCRIBED);
FREE (&mx.mbox);
if (imap_parse_path (folder, &mx) < 0)
{
dprint (1, (debugfile, "imap_mailbox_create: Bad starting path %s\n",
- folder));
+ folder));
return -1;
}
FREE (&mx.mbox);
return 0;
- fail:
+fail:
FREE (&mx.mbox);
return -1;
}
if (imap_parse_path (mailbox, &mx) < 0)
{
dprint (1, (debugfile, "imap_mailbox_rename: Bad source mailbox %s\n",
- mailbox));
+ mailbox));
return -1;
}
snprintf(buf, sizeof (buf), _("Rename mailbox %s to: "), mx.mbox);
strfcpy (newname, mx.mbox, sizeof (newname));
- if (mutt_get_field (buf, newname, sizeof (newname), MUTT_FILE) < 0)
+ if (mutt_get_field (buf, newname, sizeof (newname), MUTT_FILE) < 0)
goto fail;
if (!mutt_strlen (newname))
FREE (&mx.mbox);
return 0;
- fail:
+fail:
FREE (&mx.mbox);
return -1;
}
static int browse_add_list_result (IMAP_DATA* idata, const char* cmd,
- struct browser_state* state, short isparent)
+ struct browser_state* state, short isparent)
{
IMAP_LIST list;
IMAP_MBOX mx;
if (imap_parse_path (state->folder, &mx))
{
dprint (2, (debugfile,
- "browse_add_list_result: current folder %s makes no sense\n", state->folder));
+ "browse_add_list_result: current folder %s makes no sense\n", state->folder));
return -1;
}
* imap_unmunge_mbox_name().
*/
static void imap_add_folder (char delim, char *folder, int noselect,
- int noinferiors, struct browser_state *state, short isparent)
+ int noinferiors, struct browser_state *state, short isparent)
{
char tmp[LONG_STRING];
char relpath[LONG_STRING];
if (state->entrylen + 1 == state->entrymax)
{
safe_realloc (&state->entry,
- sizeof (struct folder_file) * (state->entrymax += 256));
+ sizeof (struct folder_file) * (state->entrymax += 256));
memset (state->entry + state->entrylen, 0,
- (sizeof (struct folder_file) * (state->entrymax - state->entrylen)));
+ (sizeof (struct folder_file) * (state->entrymax - state->entrylen)));
}
/* render superiors as unix-standard ".." */
mx_fastclose_mailbox (idata->ctx);
mutt_socket_close (idata->conn);
mutt_error (_("Mailbox %s@%s closed"),
- idata->conn->account.login, idata->conn->account.host);
+ idata->conn->account.login, idata->conn->account.host);
mutt_sleep (1);
idata->state = IMAP_DISCONNECTED;
}
* even when there is no new mail */
else if (count == idata->max_msn)
dprint (3, (debugfile,
- "cmd_handle_untagged: superfluous EXISTS message.\n"));
+ "cmd_handle_untagged: superfluous EXISTS message.\n"));
else
{
if (!(idata->reopen & IMAP_EXPUNGE_PENDING))
{
dprint (2, (debugfile,
- "cmd_handle_untagged: New mail in %s - %d messages total.\n",
- idata->mailbox, count));
+ "cmd_handle_untagged: New mail in %s - %d messages total.\n",
+ idata->mailbox, count));
idata->reopen |= IMAP_NEWMAIL_PENDING;
}
idata->newMailCount = count;
return -1;
if (!(idata = imap_conn_find (&mx.account,
- option (OPTIMAPPASSIVE) ? MUTT_IMAP_CONN_NONEW : 0)))
+ option (OPTIMAPPASSIVE) ? MUTT_IMAP_CONN_NONEW : 0)))
{
FREE (&mx.mbox);
return -1;
if (!ctx || !ctx->data) {
if (!(idata = imap_conn_find (&mx.account,
- option (OPTIMAPPASSIVE) ? MUTT_IMAP_CONN_NONEW : 0)))
+ option (OPTIMAPPASSIVE) ? MUTT_IMAP_CONN_NONEW : 0)))
{
FREE (&mx.mbox);
return -1;
return -1;
}
- if (!(mutt_bit_isset(idata->capabilities,IMAP4)
- ||mutt_bit_isset(idata->capabilities,IMAP4REV1)))
+ if (!(mutt_bit_isset(idata->capabilities,IMAP4) ||
+ mutt_bit_isset(idata->capabilities,IMAP4REV1)))
{
mutt_error _("This IMAP server is ancient. Mutt does not work with it.");
mutt_sleep (2); /* pause a moment to let the user see the error */
if (option(OPTSSLFORCETLS))
rc = MUTT_YES;
else if ((rc = query_quadoption (OPT_SSLSTARTTLS,
- _("Secure connection with TLS?"))) == -1)
+ _("Secure connection with TLS?"))) == -1)
goto err_close_conn;
if (rc == MUTT_YES) {
if ((rc = imap_exec (idata, "STARTTLS", IMAP_CMD_FAIL_OK)) == -1)
return 0;
#if defined(USE_SSL)
- err_close_conn:
+err_close_conn:
imap_close_connection (idata);
#endif
- bail:
+bail:
FREE (&idata->capstr);
return -1;
}
if (ascii_strncasecmp ("FLAGS", s, 5) != 0)
{
dprint (1, (debugfile, "imap_get_flags: not a FLAGS response: %s\n",
- s));
+ s));
return NULL;
}
s += 5;
if (*s != '(')
{
dprint (1, (debugfile, "imap_get_flags: bogus FLAGS response: %s\n",
- s));
+ s));
return NULL;
}
if (*s != ')')
{
dprint (1, (debugfile,
- "imap_get_flags: Unterminated FLAGS response: %s\n", s));
+ "imap_get_flags: Unterminated FLAGS response: %s\n", s));
mutt_free_list (hflags);
return NULL;
goto fail;
/* check for READ-ONLY notification */
- if (!ascii_strncasecmp (imap_get_qualifier (idata->buf), "[READ-ONLY]", 11) \
- && !mutt_bit_isset (idata->capabilities, ACL))
+ if (!ascii_strncasecmp (imap_get_qualifier (idata->buf), "[READ-ONLY]", 11) &&
+ !mutt_bit_isset (idata->capabilities, ACL))
{
dprint (2, (debugfile, "Mailbox is read-only.\n"));
ctx->readonly = 1;
mutt_bit_isset(idata->ctx->rights, MUTT_ACL_SEEN) ||
mutt_bit_isset(idata->ctx->rights, MUTT_ACL_WRITE) ||
mutt_bit_isset(idata->ctx->rights, MUTT_ACL_INSERT)))
- ctx->readonly = 1;
+ ctx->readonly = 1;
ctx->hdrmax = count;
ctx->hdrs = safe_calloc (count, sizeof (HEADER *));
FREE (&mx.mbox);
return 0;
- fail:
+fail:
if (idata->state == IMAP_SELECTED)
idata->state = IMAP_AUTHENTICATED;
- fail_noidata:
+fail_noidata:
FREE (&mx.mbox);
return -1;
}
/* imap_set_flag: append str to flags if we currently have permission
* according to aclbit */
static void imap_set_flag (IMAP_DATA* idata, int aclbit, int flag,
- const char *str, char *flags, size_t flsize)
+ const char *str, char *flags, size_t flsize)
{
if (mutt_bit_isset (idata->ctx->rights, aclbit))
if (flag && imap_has_flag (idata->flags, str))
cmd = mutt_buffer_new ();
/* We make a copy of the headers just in case resorting doesn't give
- exactly the original order (duplicate messages?), because other parts of
- the ctx are tied to the header order. This may be overkill. */
+ exactly the original order (duplicate messages?), because other parts of
+ the ctx are tied to the header order. This may be overkill. */
oldsort = Sort;
if (Sort != SORT_ORDER)
{
* desirable to propagate that flag into the copy.
*/
int imap_sync_message_for_copy (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd,
- int *err_continue)
+ int *err_continue)
{
char flags[LONG_STRING];
char uid[11];
imap_set_flag (idata, MUTT_ACL_WRITE, hdr->replied,
"\\Answered ", flags, sizeof (flags));
imap_set_flag (idata, MUTT_ACL_DELETE, HEADER_DATA(hdr)->deleted,
- "\\Deleted ", flags, sizeof (flags));
+ "\\Deleted ", flags, sizeof (flags));
/* now make sure we don't lose custom tags */
if (mutt_bit_isset (idata->ctx->rights, MUTT_ACL_WRITE))
rc = 0;
- out:
+out:
if (appendctx)
{
mx_fastclose_mailbox (appendctx);
imap_munge_mbox_name (idata, munged, sizeof (munged), name);
if (check_stats)
snprintf (command, sizeof (command),
- "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT MESSAGES)", munged);
+ "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT MESSAGES)", munged);
else
snprintf (command, sizeof (command),
- "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT)", munged);
+ "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT)", munged);
if (imap_exec (idata, command, IMAP_CMD_QUEUE | IMAP_CMD_POLL) < 0)
{
FREE (&mx.mbox);
return 0;
- fail:
+fail:
FREE (&mx.mbox);
return -1;
}
/* fire off command */
snprintf (buf, sizeof(buf), "%s \"\" \"%s%%\"",
- option (OPTIMAPLSUB) ? "LSUB" : "LIST", list);
+ option (OPTIMAPLSUB) ? "LSUB" : "LIST", list);
imap_cmd_start (idata, buf);
if (!mutt_account_match (&(CTX_DATA->conn->account), &(mx.account)))
{
dprint (3, (debugfile, "imap_fast_trash: %s not same server as %s\n",
- dest, ctx->path));
+ dest, ctx->path));
return 1;
}
rc = 0;
- out:
+out:
mutt_buffer_free (&sync_cmd);
FREE (&mx.mbox);
void imap_expunge_mailbox (IMAP_DATA* idata);
void imap_logout (IMAP_DATA** idata);
int imap_sync_message_for_copy (IMAP_DATA *idata, HEADER *hdr, BUFFER *cmd,
- int *err_continue);
+ int *err_continue);
int imap_has_flag (LIST* flag_list, const char* flag);
/* auth.c */
IMAP_DATA* imap_new_idata (void);
void imap_free_idata (IMAP_DATA** idata);
char* imap_fix_path (IMAP_DATA* idata, const char* mailbox, char* path,
- size_t plen);
+ size_t plen);
void imap_cachepath(IMAP_DATA* idata, const char* mailbox, char* dest,
size_t dlen);
int imap_get_literal_count (const char* buf, unsigned int* bytes);
static void flush_buffer(char* buf, size_t* len, CONNECTION* conn);
static int msg_fetch_header (CONTEXT* ctx, IMAP_HEADER* h, char* buf,
- FILE* fp);
+ FILE* fp);
static int msg_parse_fetch (IMAP_HEADER* h, char* s);
static char* msg_parse_flags (IMAP_HEADER* h, char* s);
if (mutt_bit_isset (idata->capabilities,IMAP4REV1))
{
safe_asprintf (&hdrreq, "BODY.PEEK[HEADER.FIELDS (%s%s%s)]",
- want_headers, ImapHeaders ? " " : "", NONULL (ImapHeaders));
+ want_headers, ImapHeaders ? " " : "", NONULL (ImapHeaders));
}
else if (mutt_bit_isset (idata->capabilities,IMAP4))
{
safe_asprintf (&hdrreq, "RFC822.HEADER.LINES (%s%s%s)",
- want_headers, ImapHeaders ? " " : "", NONULL (ImapHeaders));
+ want_headers, ImapHeaders ? " " : "", NONULL (ImapHeaders));
}
else
{ /* Unable to fetch headers for lower versions */
msg_cache_commit (idata, h);
- parsemsg:
+parsemsg:
/* Update the header information. Previously, we only downloaded a
* portion of the headers, those required for the main display.
*/
FREE (&mx.mbox);
return 0;
- fail:
+fail:
FREE (&mx.mbox);
return -1;
}
if (!mutt_account_match (&(CTX_DATA->conn->account), &(mx.account)))
{
dprint (3, (debugfile, "imap_copy_messages: %s not same server as %s\n",
- dest, ctx->path));
+ dest, ctx->path));
return 1;
}
rc = 0;
- out:
+out:
if (cmd.data)
FREE (&cmd.data);
if (sync_cmd.data)
return -1;
}
else if (!ascii_strncasecmp ("BODY", s, 4) ||
- !ascii_strncasecmp ("RFC822.HEADER", s, 13))
+ !ascii_strncasecmp ("RFC822.HEADER", s, 13))
{
/* handle above, in msg_fetch_header */
return -2;
if (ascii_strncasecmp ("FLAGS", s, 5) != 0)
{
dprint (1, (debugfile, "msg_parse_flags: not a FLAGS response: %s\n",
- s));
+ s));
return NULL;
}
s += 5;
if (*s != '(')
{
dprint (1, (debugfile, "msg_parse_flags: bogus FLAGS response: %s\n",
- s));
+ s));
return NULL;
}
s++;
else
{
dprint (1, (debugfile,
- "msg_parse_flags: Unterminated FLAGS response: %s\n", s));
+ "msg_parse_flags: Unterminated FLAGS response: %s\n", s));
return NULL;
}
#include "imap_private.h"
static const int Index_64[128] = {
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, 63,-1,-1,-1,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
+ -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, 63,-1,-1,-1,
+ 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1,-1,-1,-1,
+ -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
+ 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
+ -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
+ 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
};
static const char B64Chars[64] = {
* of &AMAAwA-).
*/
static char *utf7_to_utf8 (const char *u7, size_t u7len, char **u8,
- size_t *u8len)
+ size_t *u8len)
{
char *buf, *p;
int b, ch, k;
*u8 = buf;
return buf;
- bail:
+bail:
FREE (&buf);
return 0;
}
* If input data is invalid, return 0 and don't store anything.
*/
static char *utf8_to_utf7 (const char *u8, size_t u8len, char **u7,
- size_t *u7len)
+ size_t *u7len)
{
char *buf, *p;
int ch;
if (u7) *u7 = buf;
return buf;
- bail:
+bail:
FREE (&buf);
return 0;
}
b->data[0] = '\0';
rc = mutt_hcache_store_raw (idata->hcache, "/UIDSEQSET",
- b->data, seqset_size + 1,
- imap_hcache_keylen);
+ b->data, seqset_size + 1,
+ imap_hcache_keylen);
dprint (5, (debugfile, "Stored /UIDSEQSET %s\n", b->data));
mutt_buffer_free (&b);
return rc;
* Moreover, IMAP servers may dislike the path ending with the delimiter.
*/
char *imap_fix_path (IMAP_DATA *idata, const char *mailbox, char *path,
- size_t plen)
+ size_t plen)
{
int i = 0;
char delim = '\0';
tz /= 60;
snprintf (buf, IMAP_DATELEN, "%02d-%s-%d %02d:%02d:%02d %+03d%02d",
- tm->tm_mday, Months[tm->tm_mon], tm->tm_year + 1900,
- tm->tm_hour, tm->tm_min, tm->tm_sec,
- (int) tz / 60, (int) abs ((int) tz) % 60);
+ tm->tm_mday, Months[tm->tm_mon], tm->tm_year + 1900,
+ tm->tm_hour, tm->tm_min, tm->tm_sec,
+ (int) tz / 60, (int) abs ((int) tz) % 60);
}
/* imap_qualify_path: make an absolute IMAP folder target, given IMAP_MBOX
#include <sys/wait.h>
#include <sys/time.h>
-#define CHECK_PAGER \
+#define CHECK_PAGER \
if ((CurrentMenu == MENU_PAGER) && (idx >= 0) && \
- (MuttVars[idx].flags & R_RESORT)) \
- { \
- snprintf (err->data, err->dsize, "%s", \
- _("Not available in this menu.")); \
- return (-1); \
- }
+ (MuttVars[idx].flags & R_RESORT)) \
+ { \
+ snprintf (err->data, err->dsize, "%s", \
+ _("Not available in this menu.")); \
+ return (-1); \
+ }
typedef struct myvar
{
qc = ch;
else if (ch == '\\' && qc != '\'')
{
- if (!*tok->dptr)
- return -1; /* premature end of token */
+ if (!*tok->dptr)
+ return -1; /* premature end of token */
switch (ch = *tok->dptr++)
{
case 'c':
case 'C':
- if (!*tok->dptr)
- return -1; /* premature end of token */
+ if (!*tok->dptr)
+ return -1; /* premature end of token */
mutt_buffer_addch (dest, (toupper ((unsigned char) *tok->dptr)
- '@') & 0x7f);
tok->dptr++;
}
else if (ch == '^' && (flags & MUTT_TOKEN_CONDENSE))
{
- if (!*tok->dptr)
- return -1; /* premature end of token */
+ if (!*tok->dptr)
+ return -1; /* premature end of token */
ch = *tok->dptr++;
if (ch == '^')
mutt_buffer_addch (dest, ch);
switch (p->type & DT_MASK)
{
- case DT_ADDR:
- rfc822_free_address ((ADDRESS**)p->data);
- break;
- case DT_RX:
- pp = (REGEXP*)p->data;
- FREE (&pp->pattern);
- if (pp->rx)
- {
- regfree (pp->rx);
- FREE (&pp->rx);
- }
- break;
- case DT_PATH:
- case DT_STR:
- FREE ((char**)p->data); /* __FREE_CHECKED__ */
- break;
+ case DT_ADDR:
+ rfc822_free_address ((ADDRESS**)p->data);
+ break;
+ case DT_RX:
+ pp = (REGEXP*)p->data;
+ FREE (&pp->pattern);
+ if (pp->rx)
+ {
+ regfree (pp->rx);
+ FREE (&pp->rx);
+ }
+ break;
+ case DT_PATH:
+ case DT_STR:
+ FREE ((char**)p->data); /* __FREE_CHECKED__ */
+ break;
}
}
{
if (*p == '%')
{
- n = atoi(++p);
- if (n > t->nmatch)
- t->nmatch = n;
- while (*p && isdigit((int)*p))
- ++p;
+ n = atoi(++p);
+ if (n > t->nmatch)
+ t->nmatch = n;
+ while (*p && isdigit((int)*p))
+ ++p;
}
else
- ++p;
+ ++p;
}
if (t->nmatch > t->rx->rx->re_nsub)
{
snprintf (err->data, err->dsize, "%s", _("Not enough subexpressions for "
- "template"));
+ "template"));
remove_from_replace_list(list, pat);
return -1;
}
mutt_group_context_destroy (&gc);
return 0;
- bail:
+bail:
mutt_group_context_destroy (&gc);
return -1;
}
/* Add to the spam list. */
if (add_to_replace_list (&SpamList, buf->data, templ.data, err) != 0) {
- FREE(&templ.data);
- return -1;
+ FREE(&templ.data);
+ return -1;
}
FREE(&templ.data);
}
mutt_group_context_destroy (&gc);
return 0;
- bail:
+bail:
mutt_group_context_destroy (&gc);
return -1;
}
{
case NONE:
snprintf (err->data, err->dsize, _("%sgroup: missing -rx or -addr."),
- data == MUTT_UNGROUP ? "un" : "");
+ data == MUTT_UNGROUP ? "un" : "");
goto bail;
case RX:
/* Find the last item in the list that data points to. */
lastp = NULL;
dprint(5, (debugfile, "parse_attach_list: ldata = %p, *ldata = %p\n",
- (void *)ldata, (void *)*ldata));
+ (void *)ldata, (void *)*ldata));
for (listp = *ldata; listp; listp = listp->next)
{
a = (ATTACH_MATCH *)listp->data;
dprint(5, (debugfile, "parse_attach_list: skipping %s/%s\n",
- a->major, a->minor));
+ a->major, a->minor));
lastp = listp;
}
}
dprint(5, (debugfile, "parse_attach_list: added %s/%s [%d]\n",
- a->major, a->minor, a->major_int));
+ a->major, a->minor, a->major_int));
listp = safe_malloc(sizeof(LIST));
listp->data = (char *)a;
{
a = (ATTACH_MATCH *)lp->data;
dprint(5, (debugfile, "parse_unattach_list: check %s/%s [%d] : %s/%s [%d]\n",
- a->major, a->minor, a->major_int, tmp, minor, major));
+ a->major, a->minor, a->major_int, tmp, minor, major));
if (a->major_int == major && !mutt_strcasecmp(minor, a->minor))
{
dprint(5, (debugfile, "parse_unattach_list: removed %s/%s [%d]\n",
- a->major, a->minor, a->major_int));
+ a->major, a->minor, a->major_int));
regfree(&a->minor_rx);
FREE(&a->major);
mutt_group_context_destroy (&gc);
return 0;
- bail:
+bail:
mutt_group_context_destroy (&gc);
return -1;
}
mutt_group_context_destroy (&gc);
return 0;
- bail:
+bail:
mutt_group_context_destroy (&gc);
return -1;
}
*((long *) p->data) = p->init;
break;
case DT_RX:
- {
- REGEXP *pp = (REGEXP *) p->data;
- int flags = 0;
+ {
+ REGEXP *pp = (REGEXP *) p->data;
+ int flags = 0;
- FREE (&pp->pattern);
- if (pp->rx)
- {
- regfree (pp->rx);
- FREE (&pp->rx);
- }
+ FREE (&pp->pattern);
+ if (pp->rx)
+ {
+ regfree (pp->rx);
+ FREE (&pp->rx);
+ }
- if (p->init)
- {
- char *s = (char *) p->init;
+ if (p->init)
+ {
+ char *s = (char *) p->init;
- pp->rx = safe_calloc (1, sizeof (regex_t));
- pp->pattern = safe_strdup ((char *) p->init);
- if (mutt_strcmp (p->option, "mask") != 0)
- flags |= mutt_which_case ((const char *) p->init);
- if (mutt_strcmp (p->option, "mask") == 0 && *s == '!')
- {
- s++;
- pp->not = 1;
- }
- if (REGCOMP (pp->rx, s, flags) != 0)
- {
- fprintf (stderr, _("mutt_restore_default(%s): error in regexp: %s\n"),
- p->option, pp->pattern);
- FREE (&pp->pattern);
- FREE (&pp->rx);
- }
- }
+ pp->rx = safe_calloc (1, sizeof (regex_t));
+ pp->pattern = safe_strdup ((char *) p->init);
+ if (mutt_strcmp (p->option, "mask") != 0)
+ flags |= mutt_which_case ((const char *) p->init);
+ if (mutt_strcmp (p->option, "mask") == 0 && *s == '!')
+ {
+ s++;
+ pp->not = 1;
+ }
+ if (REGCOMP (pp->rx, s, flags) != 0)
+ {
+ fprintf (stderr, _("mutt_restore_default(%s): error in regexp: %s\n"),
+ p->option, pp->pattern);
+ FREE (&pp->pattern);
+ FREE (&pp->rx);
+ }
}
- break;
+ }
+ break;
}
if (p->flags & R_INDEX)
{
switch (*src)
{
- case '\n':
- ESC_CHAR('n');
- break;
- case '\r':
- ESC_CHAR('r');
- break;
- case '\t':
- ESC_CHAR('t');
- break;
- default:
- if ((*src == '\\' || *src == '"') && p - dst < len - 1)
- *p++ = '\\';
- *p++ = *src;
+ case '\n':
+ ESC_CHAR('n');
+ break;
+ case '\r':
+ ESC_CHAR('r');
+ break;
+ case '\t':
+ ESC_CHAR('t');
+ break;
+ default:
+ if ((*src == '\\' || *src == '"') && p - dst < len - 1)
+ *p++ = '\\';
+ *p++ = *src;
}
src++;
}
if (!mutt_strncmp ("my_", tmp->data, 3))
myvar = tmp->data;
else if ((idx = mutt_option_index (tmp->data)) == -1 &&
- !(reset && !mutt_strcmp ("all", tmp->data)))
+ !(reset && !mutt_strcmp ("all", tmp->data)))
{
snprintf (err->data, err->dsize, _("%s: unknown variable"), tmp->data);
return (-1);
if (query)
{
snprintf (err->data, err->dsize, option (MuttVars[idx].data)
- ? _("%s is set") : _("%s is unset"), tmp->data);
+ ? _("%s is set") : _("%s is unset"), tmp->data);
return 0;
}
{
if (CUR_ENV && CUR_ENV->subject)
{
- CUR_ENV->real_subj = (regexec (ReplyRegexp.rx,
- CUR_ENV->subject, 1, pmatch, 0)) ?
- CUR_ENV->subject :
- CUR_ENV->subject + pmatch[0].rm_eo;
+ CUR_ENV->real_subj =
+ (regexec (ReplyRegexp.rx, CUR_ENV->subject, 1, pmatch, 0)) ?
+ CUR_ENV->subject :
+ CUR_ENV->subject + pmatch[0].rm_eo;
}
}
#undef CUR_ENV
pid_t pid;
dprint (2, (debugfile, "Reading configuration file '%s'.\n",
- rcfile));
+ rcfile));
if ((f = mutt_open_read (rcfile, &pid)) == NULL)
{
{
/* the muttrc source keyword */
snprintf (err->data, err->dsize, rc >= -MAXERRS ? _("source: errors in %s")
- : _("source: reading aborted due to too many errors in %s"), rcfile);
+ : _("source: reading aborted due to too many errors in %s"), rcfile);
rc = -1;
}
return (rc);
if (Completed[0] == 0 && User_typed[0])
return 0;
- /* Num_matched will _always_ be at least 1 since the initial
- * user-typed string is always stored */
+ /* Num_matched will _always_ be at least 1 since the initial
+ * user-typed string is always stored */
if (numtabs == 1 && Num_matched == 2)
snprintf(Completed, sizeof(Completed),"%s", Matches[0]);
else if (numtabs > 1 && Num_matched > 2)
if (numtabs == 1 && Num_matched == 2)
snprintf(Completed, sizeof(Completed),"%s", Matches[0]);
else if (numtabs > 1 && Num_matched > 2)
- /* cycle thru all the matches */
+ /* cycle thru all the matches */
snprintf(Completed, sizeof(Completed), "%s",
Matches[(numtabs - 2) % Num_matched]);
if (numtabs == 1 && Num_matched == 2)
snprintf(Completed, sizeof(Completed),"%s", Matches[0]);
else if (numtabs > 1 && Num_matched > 2)
- /* cycle thru all the matches */
+ /* cycle thru all the matches */
snprintf(Completed, sizeof(Completed), "%s",
Matches[(numtabs - 2) % Num_matched]);
static char* mutt_find_cfg (const char *home, const char *xdg_cfg_home)
{
const char* names[] =
- {
- "muttrc-" MUTT_VERSION,
- "muttrc",
- NULL,
- };
+ {
+ "muttrc-" MUTT_VERSION,
+ "muttrc",
+ NULL,
+ };
const char* locations[][2] =
- {
- { home, ".", },
- { home, ".mutt/" },
- { xdg_cfg_home, "mutt/", },
- { NULL, NULL },
- };
+ {
+ { home, ".", },
+ { home, ".mutt/" },
+ { xdg_cfg_home, "mutt/", },
+ { NULL, NULL },
+ };
int i;
return 0;
- bail:
+bail:
mutt_group_context_destroy (ctx);
return -1;
}
if (Completed[0] == 0 && User_typed[0])
return 0;
- /* Num_matched will _always_ be atleast 1 since the initial
- * user-typed string is always stored */
+ /* Num_matched will _always_ be atleast 1 since the initial
+ * user-typed string is always stored */
if (numtabs == 1 && Num_matched == 2)
snprintf(Completed, sizeof(Completed), "%s", Matches[0]);
else if (numtabs > 1 && Num_matched > 2)
*/
{ "imap_check_subscribed", DT_BOOL, R_NONE, OPTIMAPCHECKSUBSCRIBED, 0 },
/*
- ** .pp
- ** When \fIset\fP, mutt will fetch the set of subscribed folders from
- ** your server on connection, and add them to the set of mailboxes
- ** it polls for new mail just as if you had issued individual ``$mailboxes''
- ** commands.
- */
+ ** .pp
+ ** When \fIset\fP, mutt will fetch the set of subscribed folders from
+ ** your server on connection, and add them to the set of mailboxes
+ ** it polls for new mail just as if you had issued individual ``$mailboxes''
+ ** commands.
+ */
{ "imap_condstore", DT_BOOL, R_NONE, OPTIMAPCONDSTORE, 0 },
/*
- ** .pp
- ** When \fIset\fP, mutt will use the CONDSTORE extension (RFC 7162)
- ** if advertised by the server. Mutt's current implementation is basic,
- ** used only for initial message fetching and flag updates.
- ** .pp
- ** For some IMAP servers, enabling this will slightly speed up
- ** downloading initial messages. Unfortunately, Gmail is not one
- ** those, and displays worse performance when enabled. Your
- ** mileage may vary.
- */
+ ** .pp
+ ** When \fIset\fP, mutt will use the CONDSTORE extension (RFC 7162)
+ ** if advertised by the server. Mutt's current implementation is basic,
+ ** used only for initial message fetching and flag updates.
+ ** .pp
+ ** For some IMAP servers, enabling this will slightly speed up
+ ** downloading initial messages. Unfortunately, Gmail is not one
+ ** those, and displays worse performance when enabled. Your
+ ** mileage may vary.
+ */
{ "imap_delim_chars", DT_STR, R_NONE, UL &ImapDelimChars, UL "/." },
/*
** .pp
*/
{ "imap_qresync", DT_BOOL, R_NONE, OPTIMAPQRESYNC, 0 },
/*
- ** .pp
- ** When \fIset\fP, mutt will use the QRESYNC extension (RFC 7162)
- ** if advertised by the server. Mutt's current implementation is basic,
- ** used only for initial message fetching and flag updates.
- ** .pp
- ** Note: this feature is currently experimental. If you experience
- ** strange behavior, such as duplicate or missing messages please
- ** file a bug report to let us know.
- */
+ ** .pp
+ ** When \fIset\fP, mutt will use the QRESYNC extension (RFC 7162)
+ ** if advertised by the server. Mutt's current implementation is basic,
+ ** used only for initial message fetching and flag updates.
+ ** .pp
+ ** Note: this feature is currently experimental. If you experience
+ ** strange behavior, such as duplicate or missing messages please
+ ** file a bug report to let us know.
+ */
{ "imap_servernoise", DT_BOOL, R_NONE, OPTIMAPSERVERNOISE, 1 },
/*
** .pp
#ifdef USE_SOCKET
{ "net_inc", DT_NUM, R_NONE, UL &NetInc, 10 },
/*
- ** .pp
- ** Operations that expect to transfer a large amount of data over the
- ** network will update their progress every $$net_inc kilobytes.
- ** If set to 0, no progress messages will be displayed.
- ** .pp
- ** See also $$read_inc, $$write_inc and $$net_inc.
- */
+ ** .pp
+ ** Operations that expect to transfer a large amount of data over the
+ ** network will update their progress every $$net_inc kilobytes.
+ ** If set to 0, no progress messages will be displayed.
+ ** .pp
+ ** See also $$read_inc, $$write_inc and $$net_inc.
+ */
#endif
{ "new_mail_command", DT_PATH, R_NONE, UL &NewMailCmd, 0 },
/*
*/
{ "ssl_force_tls", DT_BOOL, R_NONE, OPTSSLFORCETLS, 0 },
/*
- ** .pp
- ** If this variable is \fIset\fP, Mutt will require that all connections
- ** to remote servers be encrypted. Furthermore it will attempt to
- ** negotiate TLS even if the server does not advertise the capability,
- ** since it would otherwise have to abort the connection anyway. This
- ** option supersedes $$ssl_starttls.
- */
+ ** .pp
+ ** If this variable is \fIset\fP, Mutt will require that all connections
+ ** to remote servers be encrypted. Furthermore it will attempt to
+ ** negotiate TLS even if the server does not advertise the capability,
+ ** since it would otherwise have to abort the connection anyway. This
+ ** option supersedes $$ssl_starttls.
+ */
# ifdef USE_SSL_GNUTLS
{ "ssl_min_dh_prime_bits", DT_NUM, R_NONE, UL &SslDHPrimeBits, 0 },
/*
*/
{ "use_envelope_from", DT_BOOL, R_NONE, OPTENVFROM, 0 },
/*
- ** .pp
- ** When \fIset\fP, mutt will set the \fIenvelope\fP sender of the message.
- ** If $$envelope_from_address is \fIset\fP, it will be used as the sender
- ** address. If \fIunset\fP, mutt will attempt to derive the sender from the
- ** ``From:'' header.
- ** .pp
- ** Note that this information is passed to sendmail command using the
- ** \fC-f\fP command line switch. Therefore setting this option is not useful
- ** if the $$sendmail variable already contains \fC-f\fP or if the
- ** executable pointed to by $$sendmail doesn't support the \fC-f\fP switch.
- */
+ ** .pp
+ ** When \fIset\fP, mutt will set the \fIenvelope\fP sender of the message.
+ ** If $$envelope_from_address is \fIset\fP, it will be used as the sender
+ ** address. If \fIunset\fP, mutt will attempt to derive the sender from the
+ ** ``From:'' header.
+ ** .pp
+ ** Note that this information is passed to sendmail command using the
+ ** \fC-f\fP command line switch. Therefore setting this option is not useful
+ ** if the $$sendmail variable already contains \fC-f\fP or if the
+ ** executable pointed to by $$sendmail doesn't support the \fC-f\fP switch.
+ */
{ "envelope_from", DT_SYN, R_NONE, UL "use_envelope_from", 0 },
/*
*/
#include "functions.h"
const struct mapping_t Menus[] = {
- { "alias", MENU_ALIAS },
- { "attach", MENU_ATTACH },
- { "browser", MENU_FOLDER },
- { "compose", MENU_COMPOSE },
- { "editor", MENU_EDITOR },
- { "index", MENU_MAIN },
- { "pager", MENU_PAGER },
- { "postpone", MENU_POST },
- { "pgp", MENU_PGP },
- { "smime", MENU_SMIME },
+ { "alias", MENU_ALIAS },
+ { "attach", MENU_ATTACH },
+ { "browser", MENU_FOLDER },
+ { "compose", MENU_COMPOSE },
+ { "editor", MENU_EDITOR },
+ { "index", MENU_MAIN },
+ { "pager", MENU_PAGER },
+ { "postpone", MENU_POST },
+ { "pgp", MENU_PGP },
+ { "smime", MENU_SMIME },
#ifdef CRYPT_BACKEND_GPGME
- { "key_select_pgp", MENU_KEY_SELECT_PGP },
- { "key_select_smime", MENU_KEY_SELECT_SMIME },
+ { "key_select_pgp", MENU_KEY_SELECT_PGP },
+ { "key_select_smime", MENU_KEY_SELECT_SMIME },
#endif
#ifdef MIXMASTER
#endif
- { "query", MENU_QUERY },
- { "generic", MENU_GENERIC },
- { NULL, 0 }
+ { "query", MENU_QUERY },
+ { "generic", MENU_GENERIC },
+ { NULL, 0 }
};
#define mutt_check_menu(s) mutt_getvaluebyname(s, Menus)
if ((menu[i] = mutt_check_menu (p)) == -1)
{
- snprintf (err->data, err->dsize, _("%s: no such menu"), p);
- goto error;
+ snprintf (err->data, err->dsize, _("%s: no such menu"), p);
+ goto error;
}
++i;
if (q)
{
/* First check the "generic" list of commands */
if (menu[i] == MENU_PAGER || menu[i] == MENU_EDITOR ||
- menu[i] == MENU_GENERIC ||
+ menu[i] == MENU_GENERIC ||
try_bind (key, menu[i], buf->data, OpGeneric) != 0)
{
/* Now check the menu-specific list of commands (if they exist) */
if (ch != ERR && ch != ctrl ('G'))
{
mutt_message(_("Char = %s, Octal = %o, Decimal = %d"),
- km_keyname(ch), ch, ch);
+ km_keyname(ch), ch, ch);
}
}
while (ch != ERR && ch != ctrl ('G'));
if ((getcwd (abs_oldpath, sizeof abs_oldpath) == NULL) ||
(strlen (abs_oldpath) + 1 + strlen (oldpath) + 1 > sizeof abs_oldpath))
- return -1;
+ return -1;
strcat (abs_oldpath, "/"); /* __STRCAT_CHECKED__ */
strcat (abs_oldpath, oldpath); /* __STRCAT_CHECKED__ */
#ifdef EOPNOTSUPP
|| errno == EOPNOTSUPP
#endif
- )
+ )
{
dprint (1, (debugfile, "safe_rename: trying rename...\n"));
if (rename (src, target) == -1)
/* Create a temporary directory next to a file name */
static int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen,
- char *newdir, size_t ndlen)
+ char *newdir, size_t ndlen)
{
const char *basename;
char parent[_POSIX_PATH_MAX];
snprintf (newdir, ndlen, "%s/%s", parent, ".muttXXXXXX");
if (mkdtemp(newdir) == NULL)
{
- dprint(1, (debugfile, "mutt_mkwrapdir: mkdtemp() failed\n"));
- return -1;
+ dprint(1, (debugfile, "mutt_mkwrapdir: mkdtemp() failed\n"));
+ return -1;
}
if (snprintf (newfile, nflen, "%s/%s", newdir, NONULL(basename)) >= nflen)
{
- rmdir(newdir);
- dprint(1, (debugfile, "mutt_mkwrapdir: string was truncated\n"));
- return -1;
+ rmdir(newdir);
+ dprint(1, (debugfile, "mutt_mkwrapdir: string was truncated\n"));
+ return -1;
}
return 0;
}
* Returns NULL on error or a pointer to dst otherwise.
*/
char *mutt_concatn_path (char *dst, size_t dstlen,
- const char *dir, size_t dirlen, const char *fname, size_t fnamelen)
+ const char *dir, size_t dirlen, const char *fname, size_t fnamelen)
{
size_t req;
size_t offset = 0;
puts (
#ifdef HOMESPOOL
- "+HOMESPOOL "
+ "+HOMESPOOL "
#else
- "-HOMESPOOL "
+ "-HOMESPOOL "
#endif
#ifdef USE_SETGID
- "+USE_SETGID "
+ "+USE_SETGID "
#else
- "-USE_SETGID "
+ "-USE_SETGID "
#endif
#ifdef USE_DOTLOCK
- "+USE_DOTLOCK "
+ "+USE_DOTLOCK "
#else
- "-USE_DOTLOCK "
+ "-USE_DOTLOCK "
#endif
#ifdef DL_STANDALONE
- "+DL_STANDALONE "
+ "+DL_STANDALONE "
#else
- "-DL_STANDALONE "
+ "-DL_STANDALONE "
#endif
#ifdef USE_FCNTL
- "+USE_FCNTL "
+ "+USE_FCNTL "
#else
- "-USE_FCNTL "
+ "-USE_FCNTL "
#endif
#ifdef USE_FLOCK
- "+USE_FLOCK "
+ "+USE_FLOCK "
#else
- "-USE_FLOCK "
+ "-USE_FLOCK "
#endif
);
puts (
#ifdef USE_POP
- "+USE_POP "
+ "+USE_POP "
#else
- "-USE_POP "
+ "-USE_POP "
#endif
#ifdef USE_IMAP
- "+USE_IMAP "
+ "+USE_IMAP "
#else
- "-USE_IMAP "
+ "-USE_IMAP "
#endif
#ifdef USE_SMTP
- "+USE_SMTP "
+ "+USE_SMTP "
#else
- "-USE_SMTP "
+ "-USE_SMTP "
#endif
- "\n"
+ "\n"
#ifdef USE_SSL_OPENSSL
- "+USE_SSL_OPENSSL "
+ "+USE_SSL_OPENSSL "
#else
- "-USE_SSL_OPENSSL "
+ "-USE_SSL_OPENSSL "
#endif
#ifdef USE_SSL_GNUTLS
- "+USE_SSL_GNUTLS "
+ "+USE_SSL_GNUTLS "
#else
- "-USE_SSL_GNUTLS "
+ "-USE_SSL_GNUTLS "
#endif
#ifdef USE_SASL
- "+USE_SASL "
+ "+USE_SASL "
#else
- "-USE_SASL "
+ "-USE_SASL "
#endif
#ifdef USE_GSS
- "+USE_GSS "
+ "+USE_GSS "
#else
- "-USE_GSS "
+ "-USE_GSS "
#endif
#if HAVE_GETADDRINFO
- "+HAVE_GETADDRINFO "
+ "+HAVE_GETADDRINFO "
#else
- "-HAVE_GETADDRINFO "
+ "-HAVE_GETADDRINFO "
#endif
- );
+ );
puts (
#ifdef HAVE_REGCOMP
- "+HAVE_REGCOMP "
+ "+HAVE_REGCOMP "
#else
- "-HAVE_REGCOMP "
+ "-HAVE_REGCOMP "
#endif
#ifdef USE_GNU_REGEX
- "+USE_GNU_REGEX "
+ "+USE_GNU_REGEX "
#else
- "-USE_GNU_REGEX "
+ "-USE_GNU_REGEX "
#endif
- "\n"
+ "\n"
#ifdef HAVE_COLOR
- "+HAVE_COLOR "
+ "+HAVE_COLOR "
#else
- "-HAVE_COLOR "
+ "-HAVE_COLOR "
#endif
#ifdef HAVE_START_COLOR
- "+HAVE_START_COLOR "
+ "+HAVE_START_COLOR "
#else
- "-HAVE_START_COLOR "
+ "-HAVE_START_COLOR "
#endif
#ifdef HAVE_TYPEAHEAD
- "+HAVE_TYPEAHEAD "
+ "+HAVE_TYPEAHEAD "
#else
- "-HAVE_TYPEAHEAD "
+ "-HAVE_TYPEAHEAD "
#endif
#ifdef HAVE_BKGDSET
- "+HAVE_BKGDSET "
+ "+HAVE_BKGDSET "
#else
- "-HAVE_BKGDSET "
+ "-HAVE_BKGDSET "
#endif
- "\n"
+ "\n"
#ifdef HAVE_CURS_SET
- "+HAVE_CURS_SET "
+ "+HAVE_CURS_SET "
#else
- "-HAVE_CURS_SET "
+ "-HAVE_CURS_SET "
#endif
#ifdef HAVE_META
- "+HAVE_META "
+ "+HAVE_META "
#else
- "-HAVE_META "
+ "-HAVE_META "
#endif
#ifdef HAVE_RESIZETERM
- "+HAVE_RESIZETERM "
+ "+HAVE_RESIZETERM "
#else
- "-HAVE_RESIZETERM "
+ "-HAVE_RESIZETERM "
#endif
#ifdef HAVE_FUTIMENS
- "+HAVE_FUTIMENS "
+ "+HAVE_FUTIMENS "
#else
- "-HAVE_FUTIMENS "
+ "-HAVE_FUTIMENS "
#endif
- );
+ );
puts (
#ifdef CRYPT_BACKEND_CLASSIC_PGP
- "+CRYPT_BACKEND_CLASSIC_PGP "
+ "+CRYPT_BACKEND_CLASSIC_PGP "
#else
- "-CRYPT_BACKEND_CLASSIC_PGP "
+ "-CRYPT_BACKEND_CLASSIC_PGP "
#endif
#ifdef CRYPT_BACKEND_CLASSIC_SMIME
- "+CRYPT_BACKEND_CLASSIC_SMIME "
+ "+CRYPT_BACKEND_CLASSIC_SMIME "
#else
- "-CRYPT_BACKEND_CLASSIC_SMIME "
+ "-CRYPT_BACKEND_CLASSIC_SMIME "
#endif
#ifdef CRYPT_BACKEND_GPGME
- "+CRYPT_BACKEND_GPGME "
+ "+CRYPT_BACKEND_GPGME "
#else
- "-CRYPT_BACKEND_GPGME "
+ "-CRYPT_BACKEND_GPGME "
#endif
- );
+ );
puts (
#ifdef EXACT_ADDRESS
- "+EXACT_ADDRESS "
+ "+EXACT_ADDRESS "
#else
- "-EXACT_ADDRESS "
+ "-EXACT_ADDRESS "
#endif
#ifdef SUN_ATTACHMENT
- "+SUN_ATTACHMENT "
+ "+SUN_ATTACHMENT "
#else
- "-SUN_ATTACHMENT "
+ "-SUN_ATTACHMENT "
#endif
- "\n"
+ "\n"
#ifdef ENABLE_NLS
- "+ENABLE_NLS "
+ "+ENABLE_NLS "
#else
- "-ENABLE_NLS "
+ "-ENABLE_NLS "
#endif
#ifdef LOCALES_HACK
- "+LOCALES_HACK "
+ "+LOCALES_HACK "
#else
- "-LOCALES_HACK "
+ "-LOCALES_HACK "
#endif
#ifdef HAVE_WC_FUNCS
- "+HAVE_WC_FUNCS "
+ "+HAVE_WC_FUNCS "
#else
- "-HAVE_WC_FUNCS "
+ "-HAVE_WC_FUNCS "
#endif
#ifdef HAVE_LANGINFO_CODESET
- "+HAVE_LANGINFO_CODESET "
+ "+HAVE_LANGINFO_CODESET "
#else
- "-HAVE_LANGINFO_CODESET "
+ "-HAVE_LANGINFO_CODESET "
#endif
#ifdef HAVE_LANGINFO_YESEXPR
- "+HAVE_LANGINFO_YESEXPR "
+ "+HAVE_LANGINFO_YESEXPR "
#else
- "-HAVE_LANGINFO_YESEXPR "
+ "-HAVE_LANGINFO_YESEXPR "
#endif
- "\n"
+ "\n"
#if HAVE_ICONV
- "+HAVE_ICONV "
+ "+HAVE_ICONV "
#else
- "-HAVE_ICONV "
+ "-HAVE_ICONV "
#endif
#if ICONV_NONTRANS
- "+ICONV_NONTRANS "
+ "+ICONV_NONTRANS "
#else
- "-ICONV_NONTRANS "
+ "-ICONV_NONTRANS "
#endif
#if HAVE_LIBIDN
- "+HAVE_LIBIDN "
+ "+HAVE_LIBIDN "
#else
- "-HAVE_LIBIDN "
+ "-HAVE_LIBIDN "
#endif
#if HAVE_LIBIDN2
- "+HAVE_LIBIDN2 "
+ "+HAVE_LIBIDN2 "
#else
- "-HAVE_LIBIDN2 "
+ "-HAVE_LIBIDN2 "
#endif
#if HAVE_GETSID
- "+HAVE_GETSID "
+ "+HAVE_GETSID "
#else
- "-HAVE_GETSID "
+ "-HAVE_GETSID "
#endif
#if USE_HCACHE
- "+USE_HCACHE "
+ "+USE_HCACHE "
#else
- "-USE_HCACHE "
+ "-USE_HCACHE "
#endif
- "\n"
+ "\n"
#ifdef USE_SIDEBAR
- "+USE_SIDEBAR "
+ "+USE_SIDEBAR "
#else
- "-USE_SIDEBAR "
+ "-USE_SIDEBAR "
#endif
#ifdef USE_COMPRESSED
- "+USE_COMPRESSED "
+ "+USE_COMPRESSED "
#else
- "-USE_COMPRESSED "
+ "-USE_COMPRESSED "
#endif
#ifdef USE_INOTIFY
- "+USE_INOTIFY "
+ "+USE_INOTIFY "
#else
- "-USE_INOTIFY "
+ "-USE_INOTIFY "
#endif
- );
+ );
#ifdef ISPELL
printf ("ISPELL=\"%s\"\n", ISPELL);
#if HAVE_META
meta (stdscr, TRUE);
#endif
-init_extended_keys();
+ init_extended_keys();
mutt_reflow_windows ();
}
if ((i = getopt (argc, argv, "+A:a:b:F:f:c:Dd:Ee:H:s:i:hm:npQ:RvxyzZ")) != EOF)
switch (i)
{
- case 'A':
- alias_queries = mutt_add_list (alias_queries, optarg);
- break;
- case 'a':
- attach = mutt_add_list (attach, optarg);
- break;
-
- case 'F':
- mutt_str_replace (&Muttrc, optarg);
- break;
-
- case 'f':
- strfcpy (folder, optarg, sizeof (folder));
- explicit_folder = 1;
- break;
-
- case 'b':
- case 'c':
- if (!msg)
- msg = mutt_new_header ();
- if (!msg->env)
- msg->env = mutt_new_envelope ();
- if (i == 'b')
- msg->env->bcc = rfc822_parse_adrlist (msg->env->bcc, optarg);
- else
- msg->env->cc = rfc822_parse_adrlist (msg->env->cc, optarg);
- break;
+ case 'A':
+ alias_queries = mutt_add_list (alias_queries, optarg);
+ break;
+ case 'a':
+ attach = mutt_add_list (attach, optarg);
+ break;
+
+ case 'F':
+ mutt_str_replace (&Muttrc, optarg);
+ break;
+
+ case 'f':
+ strfcpy (folder, optarg, sizeof (folder));
+ explicit_folder = 1;
+ break;
+
+ case 'b':
+ case 'c':
+ if (!msg)
+ msg = mutt_new_header ();
+ if (!msg->env)
+ msg->env = mutt_new_envelope ();
+ if (i == 'b')
+ msg->env->bcc = rfc822_parse_adrlist (msg->env->bcc, optarg);
+ else
+ msg->env->cc = rfc822_parse_adrlist (msg->env->cc, optarg);
+ break;
- case 'D':
- dump_variables = 1;
- break;
+ case 'D':
+ dump_variables = 1;
+ break;
- case 'd':
+ case 'd':
#ifdef DEBUG
- if (mutt_atoi (optarg, &debuglevel) < 0 || debuglevel <= 0)
- {
- fprintf (stderr, _("Error: value '%s' is invalid for -d.\n"), optarg);
- return 1;
- }
- printf (_("Debugging at level %d.\n"), debuglevel);
+ if (mutt_atoi (optarg, &debuglevel) < 0 || debuglevel <= 0)
+ {
+ fprintf (stderr, _("Error: value '%s' is invalid for -d.\n"), optarg);
+ return 1;
+ }
+ printf (_("Debugging at level %d.\n"), debuglevel);
#else
- printf ("%s", _("DEBUG was not defined during compilation. Ignored.\n"));
+ printf ("%s", _("DEBUG was not defined during compilation. Ignored.\n"));
#endif
- break;
+ break;
- case 'E':
- edit_infile = 1;
- break;
+ case 'E':
+ edit_infile = 1;
+ break;
- case 'e':
- commands = mutt_add_list (commands, optarg);
- break;
+ case 'e':
+ commands = mutt_add_list (commands, optarg);
+ break;
- case 'H':
- draftFile = optarg;
- break;
+ case 'H':
+ draftFile = optarg;
+ break;
- case 'i':
- includeFile = optarg;
- break;
+ case 'i':
+ includeFile = optarg;
+ break;
- case 'm':
- /* should take precedence over .muttrc setting, so save it for later */
- newMagic = optarg;
- break;
+ case 'm':
+ /* should take precedence over .muttrc setting, so save it for later */
+ newMagic = optarg;
+ break;
- case 'n':
- flags |= MUTT_NOSYSRC;
- break;
+ case 'n':
+ flags |= MUTT_NOSYSRC;
+ break;
- case 'p':
- sendflags |= SENDPOSTPONED;
- break;
+ case 'p':
+ sendflags |= SENDPOSTPONED;
+ break;
- case 'Q':
- queries = mutt_add_list (queries, optarg);
- break;
+ case 'Q':
+ queries = mutt_add_list (queries, optarg);
+ break;
- case 'R':
- flags |= MUTT_RO; /* read-only mode */
- break;
+ case 'R':
+ flags |= MUTT_RO; /* read-only mode */
+ break;
- case 's':
- subject = optarg;
- break;
+ case 's':
+ subject = optarg;
+ break;
- case 'v':
- version++;
- break;
+ case 'v':
+ version++;
+ break;
- case 'x': /* mailx compatible send mode */
- sendflags |= SENDMAILX;
- break;
+ case 'x': /* mailx compatible send mode */
+ sendflags |= SENDMAILX;
+ break;
- case 'y': /* My special hack mode */
- flags |= MUTT_SELECT;
- break;
+ case 'y': /* My special hack mode */
+ flags |= MUTT_SELECT;
+ break;
- case 'z':
- flags |= MUTT_IGNORE;
- break;
+ case 'z':
+ flags |= MUTT_IGNORE;
+ break;
- case 'Z':
- flags |= MUTT_BUFFY | MUTT_IGNORE;
- break;
+ case 'Z':
+ flags |= MUTT_BUFFY | MUTT_IGNORE;
+ break;
- default:
- mutt_usage ();
+ default:
+ mutt_usage ();
}
}
/* we're not connected yet - skip mail folder creation */
if (!mx_is_imap (fpath))
#endif
- if (stat (fpath, &sb) == -1 && errno == ENOENT)
- {
- snprintf (msg, sizeof (msg), _("%s does not exist. Create it?"), Maildir);
- if (mutt_yesorno (msg, MUTT_YES) == MUTT_YES)
+ if (stat (fpath, &sb) == -1 && errno == ENOENT)
{
- if (mkdir (fpath, 0700) == -1 && errno != EEXIST)
- mutt_error ( _("Can't create %s: %s."), Maildir, strerror (errno));
+ snprintf (msg, sizeof (msg), _("%s does not exist. Create it?"), Maildir);
+ if (mutt_yesorno (msg, MUTT_YES) == MUTT_YES)
+ {
+ if (mkdir (fpath, 0700) == -1 && errno != EEXIST)
+ mutt_error ( _("Can't create %s: %s."), Maildir, strerror (errno));
+ }
}
- }
}
if (sendflags & SENDPOSTPONED)
goto bail;
}
- /* save the index of the first changed/deleted message */
+ /* save the index of the first changed/deleted message */
first = i;
/* where to start overwriting */
offset = ctx->hdrs[i]->offset;
}
else
{
- /* save the old headers */
+ /* save the old headers */
old_msgcount = ctx->msgcount;
old_hdrs = ctx->hdrs;
ctx->hdrs = NULL;
if (!(ctx->fp = safe_fopen (ctx->path, "r")))
rc = -1;
else
- rc = ((ctx->magic == MUTT_MBOX) ? mbox_parse_mailbox
- : mmdf_parse_mailbox) (ctx);
+ rc = (ctx->magic == MUTT_MBOX) ? mbox_parse_mailbox (ctx) :
+ mmdf_parse_mailbox (ctx);
break;
default:
Charset_is_utf8 = 1;
#ifndef HAVE_WC_FUNCS
else if (!ascii_strcasecmp(buffer, "euc-jp") || !ascii_strcasecmp(buffer, "shift_jis")
- || !ascii_strcasecmp(buffer, "cp932") || !ascii_strcasecmp(buffer, "eucJP-ms"))
+ || !ascii_strcasecmp(buffer, "cp932") || !ascii_strcasecmp(buffer, "eucJP-ms"))
{
charset_is_ja = 1;
if (i == menu->current)
{
- SETCOLOR(MT_COLOR_INDICATOR);
- if (option(OPTARROWCURSOR))
- {
- addstr ("->");
- ATTRSET(attr);
- addch (' ');
- }
- else
- do_color = 0;
+ SETCOLOR(MT_COLOR_INDICATOR);
+ if (option(OPTARROWCURSOR))
+ {
+ addstr ("->");
+ ATTRSET(attr);
+ addch (' ');
+ }
+ else
+ do_color = 0;
}
else if (option(OPTARROWCURSOR))
addstr(" ");
{
int c = MIN (MenuContext, menu->pagelen / 2);
- if (menu->top + 1 < menu->max - c
- && (option(OPTMENUMOVEOFF) || (menu->max > menu->pagelen && menu->top < menu->max - menu->pagelen)))
+ if ((menu->top + 1 < menu->max - c) &&
+ (option(OPTMENUMOVEOFF) ||
+ (menu->max > menu->pagelen && menu->top < menu->max - menu->pagelen)))
{
menu->top++;
if (menu->current < menu->top + c && menu->current < menu->max - 1)
if ((DIRECTION *
(tmp = (menu->current -
(menu->top + (neg ? (menu->pagelen - 1) - c : c))
- ))) < 0)
+ ))) < 0)
menu->current -= tmp;
menu->redraw = REDRAW_INDEX;
}
else
mutt_error (neg ? _("You are on the first page.")
- : _("You are on the last page."));
+ : _("You are on the last page."));
menu->current = MIN (menu->current, menu->max - 1);
menu->current = MAX (menu->current, 0);
static int default_color (int i)
{
- return ColorDefs[MT_COLOR_NORMAL];
+ return ColorDefs[MT_COLOR_NORMAL];
}
static int menu_search_generic (MUTTMENU *m, regex_t *re, int n)
if (current_menu)
{
if (menu_redraw (current_menu) == OP_REDRAW)
- /* 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.
- */
- menu_redraw (current_menu);
+ /* 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.
+ */
+ menu_redraw (current_menu);
}
}
regex_t re;
char buf[SHORT_STRING];
char* searchBuf = menu->menu >= 0 && menu->menu < MENU_MAX ?
- SearchBuffers[menu->menu] : NULL;
+ SearchBuffers[menu->menu] : NULL;
if (!(searchBuf && *searchBuf) ||
(op != OP_SEARCH_NEXT && op != OP_SEARCH_OPPOSITE))
searchBuf = SearchBuffers[menu->menu];
}
menu->searchDir = (op == OP_SEARCH || op == OP_SEARCH_NEXT) ?
- MUTT_SEARCH_DOWN : MUTT_SEARCH_UP;
+ MUTT_SEARCH_DOWN : MUTT_SEARCH_UP;
}
searchDir = (menu->searchDir == MUTT_SEARCH_UP) ? -1 : 1;
FOREVER
{
mutt_buffer_printf (path, "%s/.mutt-%s-%d-%d",
- dest->path, NONULL (Hostname), (int) getpid (), Counter++);
+ dest->path, NONULL (Hostname), (int) getpid (), Counter++);
if ((fd = open (mutt_b2s (path), O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1)
{
if (errno != EEXIST)
{
switch (*p)
{
- case 'F':
+ case 'F':
- h->flagged = 1;
- break;
+ h->flagged = 1;
+ break;
- case 'S': /* seen */
+ case 'S': /* seen */
- h->read = 1;
- break;
+ h->read = 1;
+ break;
- case 'R': /* replied */
+ case 'R': /* replied */
- h->replied = 1;
- break;
+ h->replied = 1;
+ break;
- case 'T': /* trashed */
- if (!h->flagged || !option(OPTFLAGSAFE))
- {
- h->trash = 1;
- h->deleted = 1;
- }
- break;
+ case 'T': /* trashed */
+ if (!h->flagged || !option(OPTFLAGSAFE))
+ {
+ h->trash = 1;
+ h->deleted = 1;
+ }
+ break;
- default:
- *q++ = *p;
- break;
+ default:
+ *q++ = *p;
+ break;
}
p++;
}
* This function does the second parsing pass
*/
static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
- progress_t *progress)
+ progress_t *progress)
{
struct maildir *p, *last = NULL;
BUFFER *fn = NULL;
#endif
#if HAVE_DIRENT_D_INO
-#define DO_SORT() do { \
- if (!sort) \
- { \
- dprint (4, (debugfile, "maildir: need to sort %s by inode\n", ctx->path)); \
- p = maildir_sort (p, (size_t) -1, md_cmp_inode); \
- if (!last) \
- *md = p; \
- else \
- last->next = p; \
- sort = 1; \
- p = skip_duplicates (p, &last); \
- mutt_buffer_printf (fn, "%s/%s", ctx->path, p->h->path); \
- } \
-} while(0)
+#define DO_SORT() do { \
+ if (!sort) \
+ { \
+ dprint (4, (debugfile, "maildir: need to sort %s by inode\n", ctx->path)); \
+ p = maildir_sort (p, (size_t) -1, md_cmp_inode); \
+ if (!last) \
+ *md = p; \
+ else \
+ last->next = p; \
+ sort = 1; \
+ p = skip_duplicates (p, &last); \
+ mutt_buffer_printf (fn, "%s/%s", ctx->path, p->h->path); \
+ } \
+ } while(0)
#else
#define DO_SORT() /* nothing */
#endif
fn = mutt_buffer_pool_get ();
for (p = *md, count = 0; p; p = p->next, count++)
- {
+ {
if (! (p && p->h && !p->header_parsed))
- {
+ {
last = p;
continue;
}
{
#endif /* USE_HCACHE */
- if (maildir_parse_message (ctx->magic, mutt_b2s (fn), p->h->old, p->h))
- {
- p->header_parsed = 1;
+ if (maildir_parse_message (ctx->magic, mutt_b2s (fn), p->h->old, p->h))
+ {
+ p->header_parsed = 1;
#if USE_HCACHE
- if (ctx->magic == MUTT_MH)
- mutt_hcache_store (hc, p->h->path, p->h, 0, strlen, MUTT_GENERATE_UIDVALIDITY);
- else
- mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen, MUTT_GENERATE_UIDVALIDITY);
+ if (ctx->magic == MUTT_MH)
+ mutt_hcache_store (hc, p->h->path, p->h, 0, strlen, MUTT_GENERATE_UIDVALIDITY);
+ else
+ mutt_hcache_store (hc, p->h->path + 3, p->h, 0, &maildir_hcache_keylen, MUTT_GENERATE_UIDVALIDITY);
#endif
- } else
- mutt_free_header (&p->h);
+ }
+ else
+ mutt_free_header (&p->h);
#if USE_HCACHE
}
mutt_hcache_free (&data);
#endif
last = p;
- }
+ }
#if USE_HCACHE
mutt_hcache_close (hc);
#endif
FOREVER
{
mutt_buffer_printf (path, "%s/tmp/%s.%lld.%u_%d.%s%s",
- dest->path, subdir, (long long)time (NULL), (unsigned int)getpid (),
- Counter++, NONULL (Hostname), suffix);
+ dest->path, subdir, (long long)time (NULL), (unsigned int)getpid (),
+ Counter++, NONULL (Hostname), suffix);
dprint (2, (debugfile, "maildir_open_new_message (): Trying %s.\n",
mutt_b2s (path)));
FOREVER
{
mutt_buffer_printf (path, "%s/%lld.%u_%d.%s%s", subdir,
- (long long)time (NULL), (unsigned int)getpid (), Counter++,
- NONULL (Hostname), suffix);
+ (long long)time (NULL), (unsigned int)getpid (), Counter++,
+ NONULL (Hostname), suffix);
mutt_buffer_printf (full, "%s/%s", ctx->path, mutt_b2s (path));
dprint (2, (debugfile, "_maildir_commit_message (): renaming %s to %s.\n",
if (*ctx->hdrs[i]->path != ',')
{
mutt_buffer_printf (tmp, "%s/,%s", ctx->path,
- ctx->hdrs[i]->path);
+ ctx->hdrs[i]->path);
unlink (mutt_b2s (tmp));
rename (mutt_b2s (path), mutt_b2s (tmp));
}
*/
static FILE *_maildir_open_find_message (const char *folder, const char *unique,
- const char *subfolder)
+ const char *subfolder)
{
BUFFER *dir = mutt_buffer_pool_get ();
BUFFER *tunique = mutt_buffer_pool_get ();
if (!mutt_strcmp (mutt_b2s (tunique), unique))
{
mutt_buffer_printf (fname, "%s/%s/%s", folder, subfolder,
- de->d_name);
+ de->d_name);
fp = fopen (mutt_b2s (fname), "r"); /* __FOPEN_CHECKED__ */
oe = errno;
break;
unique = mutt_buffer_pool_get ();
maildir_canon_filename (unique, msg);
- if (
- (fp =
- _maildir_open_find_message (folder, mutt_b2s (unique),
- new_hits > cur_hits ? "new" : "cur"))
+ if ((fp = _maildir_open_find_message (folder, mutt_b2s (unique),
+ new_hits > cur_hits ? "new" : "cur"))
|| errno != ENOENT)
{
if (new_hits < UINT_MAX && cur_hits < UINT_MAX)
goto cleanup;
}
- if (
- (fp =
- _maildir_open_find_message (folder, mutt_b2s (unique),
- new_hits > cur_hits ? "cur" : "new"))
+ if ((fp = _maildir_open_find_message (folder, mutt_b2s (unique),
+ new_hits > cur_hits ? "cur" : "new"))
|| errno != ENOENT)
{
if (new_hits < UINT_MAX && cur_hits < UINT_MAX)
* find old messages without having to scan both subdirs
*/
mutt_buffer_printf (realpath, "%s/%s", path,
- iter == 0 ? "cur" : "new");
+ iter == 0 ? "cur" : "new");
if ((dp = opendir (mutt_b2s (realpath))) == NULL)
{
r = -1;
#define hexval(c) Index_hex[(unsigned int)(c)]
#define base64val(c) Index_64[(unsigned int)(c)]
-#define is_multipart(x) \
- ((x)->type == TYPEMULTIPART \
- || ((x)->type == TYPEMESSAGE && (!strcasecmp((x)->subtype, "rfc822") \
- || !strcasecmp((x)->subtype, "news"))))
+#define is_multipart(x) \
+ ((x)->type == TYPEMULTIPART \
+ || ((x)->type == TYPEMESSAGE && (!strcasecmp((x)->subtype, "rfc822") \
+ || !strcasecmp((x)->subtype, "news"))))
extern const char *BodyTypes[];
extern const char *BodyEncodings[];
/* mkdtemp function for systems which don't have one */
char *mkdtemp (char *tmpl)
{
- static const char LETTERS[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- static long value = 0;
- long v;
- int len;
- int i, j;
+ static const char LETTERS[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+ static long value = 0;
+ long v;
+ int len;
+ int i, j;
- len = strlen (tmpl);
- if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX") != 0)
- {
- errno = EINVAL;
- return NULL;
- }
+ len = strlen (tmpl);
+ if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX") != 0)
+ {
+ errno = EINVAL;
+ return NULL;
+ }
- value += ((long) time (NULL)) ^ getpid ();
+ value += ((long) time (NULL)) ^ getpid ();
- for (i = 0; i < 7 ; ++i, value += 7777)
+ for (i = 0; i < 7 ; ++i, value += 7777)
+ {
+ /* fill in the random bits */
+ for (j = 0, v = value; j < 6; ++j)
{
- /* fill in the random bits */
- for (j = 0, v = value; j < 6; ++j)
- {
- tmpl[(len - 6) + j] = LETTERS[v % 62];
- v /= 62;
- }
-
- /* try to create the directory */
- if (mkdir (tmpl, 0700) == 0)
- return tmpl;
- else if (errno != EEXIST)
- return NULL;
+ tmpl[(len - 6) + j] = LETTERS[v % 62];
+ v /= 62;
}
- errno = EEXIST;
- return NULL;
+ /* try to create the directory */
+ if (mkdir (tmpl, 0700) == 0)
+ return tmpl;
+ else if (errno != EEXIST)
+ return NULL;
+ }
+
+ errno = EEXIST;
+ return NULL;
}
unsigned int deleted : 1; /* attachment marked for deletion */
unsigned int noconv : 1; /* don't do character set conversion */
- unsigned int force_charset : 1;
- /* send mode: don't adjust the character
- * set when in send-mode.
- */
+ unsigned int force_charset : 1; /* send mode: don't adjust the character
+ * set when in send-mode.
+ */
unsigned int is_signed_data : 1; /* A lot of MUAs don't indicate
S/MIME signed-data correctly,
e.g. they use foo.p7m even for
typedef struct header
{
unsigned int security : 12; /* bit 0-8: flags, bit 9,10: application.
- see: mutt_crypt.h pgplib.h, smime.h */
+ see: mutt_crypt.h pgplib.h, smime.h */
unsigned int mime : 1; /* has a MIME-Version header? */
unsigned int flagged : 1; /* marked important? */
*/
/*
- Common definitions and prototypes for the crypt functions. They are
- all defined in crypt.c and cryptglue.c
+ Common definitions and prototypes for the crypt functions. They are
+ all defined in crypt.c and cryptglue.c
*/
#ifndef MUTT_CRYPT_H
*ppl Start of long key ID if detected, else NULL.
*pps Start of short key ID if detected, else NULL. */
const char* crypt_get_fingerprint_or_id (char *p, const char **pphint,
- const char **ppl, const char **pps);
+ const char **ppl, const char **pps);
/* Check if a string contains a numerical key */
short crypt_is_numerical_keyid (const char *s);
* by preprocessor at the macro-expansion time.
* Note that #a escapes and double quotes the argument.
*/
-#define H_TO_INTL(a) \
- if (mutt_addrlist_to_intl (env->a, err) && !e) \
- { \
- if (tag) *tag = #a; e = 1; err = NULL; \
+#define H_TO_INTL(a) \
+ if (mutt_addrlist_to_intl (env->a, err) && !e) \
+ { \
+ if (tag) *tag = #a; e = 1; err = NULL; \
}
int mutt_env_to_intl (ENVELOPE *env, char **tag, char **err)
dprint (1, (debugfile, "getnameinfo: "));
switch(ret)
{
- case EAI_AGAIN:
- dprint (1, (debugfile, "The name could not be resolved at this time. Future attempts may succeed.\n"));
- err=SASL_TRYAGAIN;
- break;
- case EAI_BADFLAGS:
- dprint (1, (debugfile, "The flags had an invalid value.\n"));
- err=SASL_BADPARAM;
- break;
- case EAI_FAIL:
- dprint (1, (debugfile, "A non-recoverable error occurred.\n"));
- err=SASL_FAIL;
- break;
- case EAI_FAMILY:
- dprint (1, (debugfile, "The address family was not recognized or the address length was invalid for the specified family.\n"));
- err=SASL_BADPROT;
- break;
- case EAI_MEMORY:
- dprint (1, (debugfile, "There was a memory allocation failure.\n"));
- err=SASL_NOMEM;
- break;
- case EAI_NONAME:
- dprint (1, (debugfile, "The name does not resolve for the supplied parameters. NI_NAMEREQD is set and the host's name cannot be located, or both nodename and servname were null.\n"));
- err=SASL_FAIL; /* no real equivalent */
- break;
- case EAI_SYSTEM:
- dprint (1, (debugfile, "A system error occurred. The error code can be found in errno(%d,%s)).\n",errno,strerror(errno)));
- err=SASL_FAIL; /* no real equivalent */
- break;
- default:
- dprint (1, (debugfile, "Unknown error %d\n",ret));
- err=SASL_FAIL; /* no real equivalent */
- break;
+ case EAI_AGAIN:
+ dprint (1, (debugfile, "The name could not be resolved at this time. Future attempts may succeed.\n"));
+ err=SASL_TRYAGAIN;
+ break;
+ case EAI_BADFLAGS:
+ dprint (1, (debugfile, "The flags had an invalid value.\n"));
+ err=SASL_BADPARAM;
+ break;
+ case EAI_FAIL:
+ dprint (1, (debugfile, "A non-recoverable error occurred.\n"));
+ err=SASL_FAIL;
+ break;
+ case EAI_FAMILY:
+ dprint (1, (debugfile, "The address family was not recognized or the address length was invalid for the specified family.\n"));
+ err=SASL_BADPROT;
+ break;
+ case EAI_MEMORY:
+ dprint (1, (debugfile, "There was a memory allocation failure.\n"));
+ err=SASL_NOMEM;
+ break;
+ case EAI_NONAME:
+ dprint (1, (debugfile, "The name does not resolve for the supplied parameters. NI_NAMEREQD is set and the host's name cannot be located, or both nodename and servname were null.\n"));
+ err=SASL_FAIL; /* no real equivalent */
+ break;
+ case EAI_SYSTEM:
+ dprint (1, (debugfile, "A system error occurred. The error code can be found in errno(%d,%s)).\n",errno,strerror(errno)));
+ err=SASL_FAIL; /* no real equivalent */
+ break;
+ default:
+ dprint (1, (debugfile, "Unknown error %d\n",ret));
+ err=SASL_FAIL; /* no real equivalent */
+ break;
}
return err;
}
/* callbacks */
static int mutt_sasl_cb_log (void* context, int priority, const char* message);
static int mutt_sasl_cb_authname (void* context, int id, const char** result,
- unsigned int* len);
+ unsigned int* len);
static int mutt_sasl_cb_pass (sasl_conn_t* conn, void* context, int id,
- sasl_secret_t** psecret);
+ sasl_secret_t** psecret);
/* socket wrappers for a SASL security layer */
static int mutt_sasl_conn_open (CONNECTION* conn);
static int mutt_sasl_conn_close (CONNECTION* conn);
static int mutt_sasl_conn_read (CONNECTION* conn, char* buf, size_t len);
static int mutt_sasl_conn_write (CONNECTION* conn, const char* buf,
- size_t count);
+ size_t count);
static int mutt_sasl_conn_poll (CONNECTION* conn, time_t wait_secs);
/* utility function, stolen from sasl2 sample code */
NONULL(prp)));
rc = sasl_client_new (service, conn->account.host, plp, prp,
- mutt_sasl_get_callbacks (&conn->account), 0, saslconn);
+ mutt_sasl_get_callbacks (&conn->account), 0, saslconn);
if (rc != SASL_OK)
{
/* mutt_sasl_cb_authname: callback to retrieve authname or user from ACCOUNT */
static int mutt_sasl_cb_authname (void* context, int id, const char** result,
- unsigned* len)
+ unsigned* len)
{
ACCOUNT* account = (ACCOUNT*) context;
}
static int mutt_sasl_cb_pass (sasl_conn_t* conn, void* context, int id,
- sasl_secret_t** psecret)
+ sasl_secret_t** psecret)
{
ACCOUNT* account = (ACCOUNT*) context;
int len;
return SASL_BADPARAM;
dprint (2, (debugfile,
- "mutt_sasl_cb_pass: getting password for %s@%s:%u\n", account->login,
- account->host, account->port));
+ "mutt_sasl_cb_pass: getting password for %s@%s:%u\n", account->login,
+ account->host, account->port));
if (mutt_account_getpass (account))
return SASL_FAIL;
goto out;
rc = sasl_decode (sasldata->saslconn, buf, rc, &sasldata->buf,
- &sasldata->blen);
+ &sasldata->blen);
if (rc != SASL_OK)
{
dprint (1, (debugfile, "SASL decode failed: %s\n",
- sasl_errstring (rc, NULL, NULL)));
+ sasl_errstring (rc, NULL, NULL)));
goto out;
}
}
else
rc = (sasldata->msasl_read) (conn, buf, len);
- out:
- conn->sockdata = sasldata;
+out:
+ conn->sockdata = sasldata;
- return rc;
+ return rc;
}
static int mutt_sasl_conn_write (CONNECTION* conn, const char* buf,
- size_t len)
+ size_t len)
{
SASL_DATA* sasldata;
int rc;
if (rc != SASL_OK)
{
dprint (1, (debugfile, "SASL encoding failed: %s\n",
- sasl_errstring (rc, NULL, NULL)));
+ sasl_errstring (rc, NULL, NULL)));
goto fail;
}
while (len > *sasldata->pbufsize);
}
else
- /* just write using the underlying socket function */
+ /* just write using the underlying socket function */
rc = (sasldata->msasl_write) (conn, buf, len);
conn->sockdata = sasldata;
return rc;
- fail:
+fail:
conn->sockdata = sasldata;
return -1;
}
}
if (ConnectTimeout > 0)
- alarm (ConnectTimeout);
+ alarm (ConnectTimeout);
mutt_allow_interrupt (1);
if (connect (fd, sa, sa_size) < 0)
{
- save_errno = errno;
- dprint (2, (debugfile, "Connection failed. errno: %d...\n", errno));
- SigInt = 0; /* reset in case we caught SIGINTR while in connect() */
+ save_errno = errno;
+ dprint (2, (debugfile, "Connection failed. errno: %d...\n", errno));
+ SigInt = 0; /* reset in case we caught SIGINTR while in connect() */
}
if (ConnectTimeout > 0)
- alarm (0);
+ alarm (0);
mutt_allow_interrupt (0);
sigprocmask (SIG_UNBLOCK, &set, NULL);
he = gethostbyname (host_idna);
# if defined(HAVE_LIBIDN) || defined(HAVE_LIBIDN2)
- FREE (&host_idna);
+ FREE (&host_idna);
# endif
if (! he) {
if (rc)
{
mutt_error (_("Could not connect to %s (%s)."), conn->account.host,
- (rc > 0) ? strerror (rc) : _("unknown error"));
+ (rc > 0) ? strerror (rc) : _("unknown error"));
mutt_sleep (2);
return -1;
}
(X509_cmp_current_time (X509_get0_notAfter (cert)) <= 0))
{
dprint (2, (debugfile, "ssl_load_certificates: filtering expired cert: %s\n",
- X509_NAME_oneline (X509_get_subject_name (cert), buf, sizeof (buf))));
+ X509_NAME_oneline (X509_get_subject_name (cert), buf, sizeof (buf))));
}
else
{
conn->conn_close = tls_close;
conn->ssf = SSL_CIPHER_get_bits (SSL_get_current_cipher (ssldata->ssl),
- &maxbits);
+ &maxbits);
return 0;
- bail_ssl:
+bail_ssl:
SSL_free (ssldata->ssl);
ssldata->ssl = 0;
- bail_ctx:
+bail_ctx:
SSL_CTX_free (ssldata->ctx);
ssldata->ctx = 0;
- bail_ssldata:
+bail_ssldata:
FREE (&ssldata);
- bail:
+bail:
return -1;
}
data->isopen = 1;
conn->ssf = SSL_CIPHER_get_bits (SSL_get_current_cipher (data->ssl),
- &maxbits);
+ &maxbits);
return 0;
}
{
switch (SSL_get_error (ssldata->ssl, err))
{
- case SSL_ERROR_SYSCALL:
- errmsg = _("I/O error");
- break;
- case SSL_ERROR_SSL:
- errmsg = ERR_error_string (ERR_get_error (), NULL);
- break;
- default:
- errmsg = _("unknown error");
+ case SSL_ERROR_SYSCALL:
+ errmsg = _("I/O error");
+ break;
+ case SSL_ERROR_SSL:
+ errmsg = ERR_error_string (ERR_get_error (), NULL);
+ break;
+ default:
+ errmsg = _("unknown error");
}
mutt_error (_("SSL failed: %s"), errmsg);
%2$s is cipher_version (e.g. "TLSv1/SSLv3")
%3$s is cipher_name (e.g. "ECDHE-RSA-AES128-GCM-SHA256") */
mutt_message (_("%s connection using %s (%s)"),
- SSL_get_version(ssldata->ssl), SSL_get_cipher_version (ssldata->ssl), SSL_get_cipher_name (ssldata->ssl));
+ SSL_get_version(ssldata->ssl),
+ SSL_get_cipher_version (ssldata->ssl),
+ SSL_get_cipher_name (ssldata->ssl));
mutt_sleep (0);
return 0;
switch (SSL_get_error (data->ssl, err))
{
- case SSL_ERROR_NONE:
- return;
- case SSL_ERROR_ZERO_RETURN:
- errmsg = "SSL connection closed";
- data->isopen = 0;
- break;
- case SSL_ERROR_WANT_READ:
- errmsg = "retry read";
- break;
- case SSL_ERROR_WANT_WRITE:
- errmsg = "retry write";
- break;
- case SSL_ERROR_WANT_CONNECT:
- errmsg = "retry connect";
- break;
- case SSL_ERROR_WANT_ACCEPT:
- errmsg = "retry accept";
- break;
- case SSL_ERROR_WANT_X509_LOOKUP:
- errmsg = "retry x509 lookup";
- break;
- case SSL_ERROR_SYSCALL:
- errmsg = "I/O error";
- data->isopen = 0;
- break;
- case SSL_ERROR_SSL:
- sslerr = ERR_get_error ();
- switch (sslerr)
- {
- case 0:
- switch (err)
+ case SSL_ERROR_NONE:
+ return;
+ case SSL_ERROR_ZERO_RETURN:
+ errmsg = "SSL connection closed";
+ data->isopen = 0;
+ break;
+ case SSL_ERROR_WANT_READ:
+ errmsg = "retry read";
+ break;
+ case SSL_ERROR_WANT_WRITE:
+ errmsg = "retry write";
+ break;
+ case SSL_ERROR_WANT_CONNECT:
+ errmsg = "retry connect";
+ break;
+ case SSL_ERROR_WANT_ACCEPT:
+ errmsg = "retry accept";
+ break;
+ case SSL_ERROR_WANT_X509_LOOKUP:
+ errmsg = "retry x509 lookup";
+ break;
+ case SSL_ERROR_SYSCALL:
+ errmsg = "I/O error";
+ data->isopen = 0;
+ break;
+ case SSL_ERROR_SSL:
+ sslerr = ERR_get_error ();
+ switch (sslerr)
{
- case 0:
- errmsg = "EOF";
- break;
- default:
- errmsg = strerror(errno);
+ case 0:
+ switch (err)
+ {
+ case 0:
+ errmsg = "EOF";
+ break;
+ default:
+ errmsg = strerror(errno);
+ }
+ break;
+ default:
+ errmsg = ERR_error_string (sslerr, NULL);
}
break;
default:
- errmsg = ERR_error_string (sslerr, NULL);
- }
- break;
- default:
- errmsg = "unknown error";
+ errmsg = "unknown error";
}
dprint (1, (debugfile, "SSL error: %s\n", errmsg));
}
static int compare_certificates (X509 *cert, X509 *peercert,
- unsigned char *peermd, unsigned int peermdlen)
+ unsigned char *peermd, unsigned int peermdlen)
{
unsigned char md[EVP_MAX_MD_SIZE];
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 -1;
{
int err = X509_STORE_CTX_get_error (ctx);
snprintf (buf, sizeof (buf), "%s (%d)",
- X509_verify_cert_error_string (err), err);
+ X509_verify_cert_error_string (err), err);
dprint (2, (debugfile, "X509_verify_cert: %s\n", buf));
}
#endif
- /* prompt user */
+ /* prompt user */
return interactive_check_cert (cert, pos, len, ssl, 1);
}
row++;
snprintf (menu->dialog[row++], SHORT_STRING, "%s", _("This certificate is valid"));
snprintf (menu->dialog[row++], SHORT_STRING, _(" from %s"),
- asn1time_to_string (X509_getm_notBefore (cert)));
+ asn1time_to_string (X509_getm_notBefore (cert)));
snprintf (menu->dialog[row++], SHORT_STRING, _(" to %s"),
- asn1time_to_string (X509_getm_notAfter (cert)));
+ asn1time_to_string (X509_getm_notAfter (cert)));
row++;
buf[0] = '\0';
* to also scan the certificate file here.
*/
allow_always = allow_always &&
- SslCertFile &&
- check_certificate_expiration (cert, 1);
+ SslCertFile &&
+ check_certificate_expiration (cert, 1);
/* L10N:
* These four letters correspond to the choices in the next four strings:
return 0;
- fail:
+fail:
gnutls_certificate_free_credentials (data->xcred);
gnutls_deinit (data->state);
FREE(&conn->sockdata);
int i, row, done, ret;
if (!tls_check_preauth (certdata, certstat, hostname, idx, &certerr,
- &savedcert))
+ &savedcert))
return 1;
/* interactive check from user */
len - idx, len);
menu->title = title;
/* certificates with bad dates, or that are revoked, must be
- accepted manually each and every time */
+ accepted manually each and every time */
if (SslCertFile && !savedcert
- && !(certerr & (CERTERR_EXPIRED | CERTERR_NOTYETVALID
- | CERTERR_REVOKED)))
+ && !(certerr & (CERTERR_EXPIRED | CERTERR_NOTYETVALID
+ | CERTERR_REVOKED)))
{
menu->prompt = _("(r)eject, accept (o)nce, (a)ccept always");
- /* L10N:
- * These three letters correspond to the choices in the string:
- * (r)eject, accept (o)nce, (a)ccept always.
- * This is an interactive certificate confirmation prompt for
- * a GNUTLS connection.
- */
+ /* L10N:
+ * These three letters correspond to the choices in the string:
+ * (r)eject, accept (o)nce, (a)ccept always.
+ * This is an interactive certificate confirmation prompt for
+ * a GNUTLS connection.
+ */
menu->keys = _("roa");
}
else
{
menu->prompt = _("(r)eject, accept (o)nce");
- /* L10N:
- * These two letters correspond to the choices in the string:
- * (r)eject, accept (o)nce.
- * These is an interactive certificate confirmation prompt for
- * a GNUTLS connection.
- */
+ /* L10N:
+ * These two letters correspond to the choices in the string:
+ * (r)eject, accept (o)nce.
+ * These is an interactive certificate confirmation prompt for
+ * a GNUTLS connection.
+ */
menu->keys = _("ro");
}
}
mutt_buffer_mktemp_pfx_sfx (buf, mutt_b2s (prefix), suffix);
-out:
+ out:
mutt_buffer_pool_release (&prefix);
}
}
if (b->unlink)
unlink (b->filename);
dprint (1, (debugfile, "mutt_free_body: %sunlinking %s.\n",
- b->unlink ? "" : "not ", b->filename));
+ b->unlink ? "" : "not ", b->filename));
}
FREE (&b->filename);
strfcpy (p, NONULL (Maildir), sizeof (p));
else
#endif
- if (Maildir && *Maildir && Maildir[strlen (Maildir) - 1] == '/')
- strfcpy (p, NONULL (Maildir), sizeof (p));
- else
- snprintf (p, sizeof (p), "%s/", NONULL (Maildir));
+ if (Maildir && *Maildir && Maildir[strlen (Maildir) - 1] == '/')
+ strfcpy (p, NONULL (Maildir), sizeof (p));
+ else
+ snprintf (p, sizeof (p), "%s/", NONULL (Maildir));
tail = s + 1;
}
void mutt_merge_envelopes(ENVELOPE* base, ENVELOPE** extra)
{
/* copies each existing element if necessary, and sets the element
- * to NULL in the source so that mutt_free_envelope doesn't leave us
- * with dangling pointers. */
+ * to NULL in the source so that mutt_free_envelope doesn't leave us
+ * with dangling pointers. */
#define MOVE_ELEM(h) if (!base->h) { base->h = (*extra)->h; (*extra)->h = NULL; }
MOVE_ELEM(return_path);
MOVE_ELEM(from);
(*extra)->disp_subj = NULL;
}
/* spam and user headers should never be hashed, and the new envelope may
- * have better values. Use new versions regardless. */
+ * have better values. Use new versions regardless. */
mutt_buffer_free (&base->spam);
mutt_free_list (&base->userhdrs);
MOVE_ELEM(spam);
const char *src, int line)
{
mutt_buffer_printf (buf, "%s/%s-%s-%d-%d-%ld%ld%s%s",
- NONULL (Tempdir), NONULL (prefix), NONULL (Hostname),
- (int) getuid (), (int) getpid (), random (), random (),
- suffix ? "." : "", NONULL (suffix));
+ NONULL (Tempdir), NONULL (prefix), NONULL (Hostname),
+ (int) getuid (), (int) getpid (), random (), random (),
+ suffix ? "." : "", NONULL (suffix));
dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, mutt_b2s (buf)));
if (unlink (mutt_b2s (buf)) && errno != ENOENT)
dprint (1, (debugfile, "%s:%d: ERROR: unlink(\"%s\"): %s (errno %d)\n",
const char *src, int line)
{
size_t n = snprintf (s, slen, "%s/%s-%s-%d-%d-%ld%ld%s%s",
- NONULL (Tempdir), NONULL (prefix), NONULL (Hostname),
- (int) getuid (), (int) getpid (), random (), random (),
- suffix ? "." : "", NONULL (suffix));
+ NONULL (Tempdir), NONULL (prefix), NONULL (Hostname),
+ (int) getuid (), (int) getpid (), random (), random (),
+ suffix ? "." : "", NONULL (suffix));
if (n >= slen)
dprint (1, (debugfile, "%s:%d: ERROR: insufficient buffer space to hold temporary filename! slen=%zu but need %zu\n",
- src, line, slen, n));
+ src, line, slen, n));
dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s));
if (unlink (s) && errno != ENOENT)
dprint (1, (debugfile, "%s:%d: ERROR: unlink(\"%s\"): %s (errno %d)\n", src, line, s, strerror (errno), errno));
/* return 0 on success, -1 on abort, 1 on error */
int mutt_check_overwrite (const char *attname, const char *path,
- char *fname, size_t flen, int *append, char **directory)
+ char *fname, size_t flen, int *append, char **directory)
{
int rc = 0;
char tmp[_POSIX_PATH_MAX];
if (directory)
{
switch (mutt_multi_choice
- /* L10N:
- Means "The path you specified as the destination file is a directory."
- See the msgid "Save to file: " (alias.c, recvattach.c) */
+ /* L10N:
+ Means "The path you specified as the destination file is a directory."
+ See the msgid "Save to file: " (alias.c, recvattach.c) */
(_("File is a directory, save under it? [(y)es, (n)o, (a)ll]"), _("yna")))
{
case 3: /* all */
strfcpy (tmp, mutt_basename (NONULL (attname)), sizeof (tmp));
if (mutt_get_field (_("File under directory: "), tmp, sizeof (tmp),
- MUTT_FILE | MUTT_CLEAR) != 0 || !tmp[0])
+ MUTT_FILE | MUTT_CLEAR) != 0 || !tmp[0])
return (-1);
mutt_concat_path (fname, path, tmp, flen);
}
char *p = buf;
for (; *p; p++)
if (*p == '.')
- *p = '_';
+ *p = '_';
}
if ((len = mutt_strlen (buf)) + wlen > destlen)
{
int i;
#ifdef HAVE_UTIMENSAT
- struct timespec ts[2];
+ struct timespec ts[2];
#else
- struct utimbuf ut;
+ struct utimbuf ut;
#endif /* HAVE_UTIMENSAT */
if(!ctx)
if (ctx->deleted && !(ctx->magic == MUTT_MAILDIR && option (OPTMAILDIRTRASH)))
{
snprintf (buf, sizeof (buf), ctx->deleted == 1
- ? _("Purge %d deleted message?") : _("Purge %d deleted messages?"),
+ ? _("Purge %d deleted message?") : _("Purge %d deleted messages?"),
ctx->deleted);
if ((purge = query_quadoption (OPT_DELETE, buf)) < 0)
{
{
if (move_messages)
mutt_message (_("%d kept, %d moved, %d deleted."),
- ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted);
+ ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted);
else
mutt_message (_("%d kept, %d deleted."),
- ctx->msgcount - ctx->deleted, ctx->deleted);
+ ctx->msgcount - ctx->deleted, ctx->deleted);
}
if (ctx->msgcount == ctx->deleted &&
ctx->v2r[ctx->vcount] = j;
ctx->hdrs[j]->virtual = ctx->vcount++;
ctx->vsize += this_body->length + this_body->offset -
- this_body->hdr_offset + padding;
+ this_body->hdr_offset + padding;
}
if (committing)
char buf[SHORT_STRING];
snprintf (buf, sizeof (buf), ctx->deleted == 1
- ? _("Purge %d deleted message?") : _("Purge %d deleted messages?"),
+ ? _("Purge %d deleted message?") : _("Purge %d deleted messages?"),
ctx->deleted);
if ((purge = query_quadoption (OPT_DELETE, buf)) < 0)
return (-1);
if (!dest->mx_ops || !dest->mx_ops->open_new_msg)
{
- dprint (1, (debugfile, "mx_open_new_message(): function unimplemented for mailbox type %d.\n",
- dest->magic));
- return NULL;
+ dprint (1, (debugfile, "mx_open_new_message(): function unimplemented for mailbox type %d.\n",
+ dest->magic));
+ return NULL;
}
msg = safe_calloc (1, sizeof (MESSAGE));
if ((*msg)->path)
{
dprint (1, (debugfile, "mx_close_message (): unlinking %s\n",
- (*msg)->path));
+ (*msg)->path));
unlink ((*msg)->path);
FREE (&(*msg)->path);
}
static int TopLine = 0;
static HEADER *OldHdr = NULL;
-#define CHECK_MODE(x) if (!(x)) \
- { \
- mutt_flushinp (); \
- mutt_error _(Not_available_in_this_menu); \
- break; \
- }
-
-#define CHECK_READONLY if (Context->readonly) \
- { \
- mutt_flushinp (); \
- mutt_error _(Mailbox_is_read_only); \
- break; \
- }
-
-#define CHECK_ATTACH if(option(OPTATTACHMSG)) \
- {\
- mutt_flushinp (); \
- mutt_error _(Function_not_permitted_in_attach_message_mode); \
- break; \
- }
-
-#define CHECK_ACL(aclbit,action) \
- if (!mutt_bit_isset(Context->rights,aclbit)) { \
- mutt_flushinp(); \
- /* L10N: %s is one of the CHECK_ACL entries below. */ \
- mutt_error (_("%s: Operation not permitted by ACL"), action); \
- break; \
- }
+#define CHECK_MODE(x) \
+ if (!(x)) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(Not_available_in_this_menu); \
+ break; \
+ }
+
+#define CHECK_READONLY \
+ if (Context->readonly) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(Mailbox_is_read_only); \
+ break; \
+ }
+
+#define CHECK_ATTACH \
+ if(option(OPTATTACHMSG)) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(Function_not_permitted_in_attach_message_mode); \
+ break; \
+ }
+
+#define CHECK_ACL(aclbit,action) \
+ if (!mutt_bit_isset(Context->rights,aclbit)) \
+ { \
+ mutt_flushinp(); \
+ /* L10N: %s is one of the CHECK_ACL entries below. */ \
+ mutt_error (_("%s: Operation not permitted by ACL"), action); \
+ break; \
+ }
struct q_class_t
{
static void
resolve_color (struct line_t *lineInfo, int n, int cnt, int flags, int special,
- ansi_attr *a)
+ ansi_attr *a)
{
int def_color; /* color without syntax highlight */
int color; /* final color */
a->pair = mutt_alloc_color (a->fg, a->bg);
color = a->pair;
if (a->attr & ANSI_BOLD)
- color |= A_BOLD;
+ color |= A_BOLD;
}
else
#endif
if ((special & A_BOLD) || (a->attr & ANSI_BOLD))
- {
- if (ColorDefs[MT_COLOR_BOLD] && !search)
- color = ColorDefs[MT_COLOR_BOLD];
- else
- color ^= A_BOLD;
- }
+ {
+ if (ColorDefs[MT_COLOR_BOLD] && !search)
+ color = ColorDefs[MT_COLOR_BOLD];
+ else
+ color ^= A_BOLD;
+ }
if ((special & A_UNDERLINE) || (a->attr & ANSI_UNDERLINE))
{
if (ColorDefs[MT_COLOR_UNDERLINE] && !search)
static void
shift_class_colors (struct q_class_t *QuoteList, struct q_class_t *new_class,
- int index, int *q_level)
+ int index, int *q_level)
{
struct q_class_t * q_list;
if (tmp == NULL)
{
/* add a node above q_list */
- tmp = (struct q_class_t *) safe_calloc (1,
- sizeof (struct q_class_t));
+ tmp = (struct q_class_t *)
+ safe_calloc (1, sizeof (struct q_class_t));
tmp->prefix = (char *) safe_calloc (1, length + 1);
strncpy (tmp->prefix, qptr, length);
tmp->length = length;
{
/* longer than the current prefix: try subclassing it */
if (tmp == NULL && mutt_strncmp (tail_qptr, (q_list->prefix) + offset,
- q_list->length - offset) == 0)
+ q_list->length - offset) == 0)
{
/* still a subclass: go down one level */
ptr = q_list;
static void
resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last,
- struct q_class_t **QuoteList, int *q_level, int *force_redraw,
- int q_classify)
+ struct q_class_t **QuoteList, int *q_level, int *force_redraw,
+ int q_classify)
{
COLOR_LINE *color_line, *color_list;
regmatch_t pmatch[1];
(lineInfo[i].type == MT_COLOR_NORMAL ||
lineInfo[i].type == MT_COLOR_QUOTED ||
lineInfo[i].type == MT_COLOR_HEADER))
+ {
+ /* oops... */
+ if (lineInfo[i].chunks)
{
- /* oops... */
- if (lineInfo[i].chunks)
- {
- lineInfo[i].chunks = 0;
- safe_realloc (&(lineInfo[n].syntax),
- sizeof (struct syntax_t));
- }
- lineInfo[i++].type = MT_COLOR_SIGNATURE;
+ lineInfo[i].chunks = 0;
+ safe_realloc (&(lineInfo[n].syntax),
+ sizeof (struct syntax_t));
}
+ lineInfo[i++].type = MT_COLOR_SIGNATURE;
+ }
}
else if (check_sig (buf, lineInfo, n - 1) == 0)
lineInfo[n].type = MT_COLOR_SIGNATURE;
}
resolve_types ((char *) fmt, (char *) buf, *lineInfo, n, *last,
- QuoteList, q_level, force_redraw, flags & MUTT_SHOWCOLOR);
+ QuoteList, q_level, force_redraw, flags & MUTT_SHOWCOLOR);
/* avoid race condition for continuation lines when scrolling up */
for (m = n + 1; m < *last && (*lineInfo)[m].offset && (*lineInfo)[m].continuation; m++)
goto out;
}
regexec ((regex_t *) QuoteRegexp.rx, (char *) fmt, 1, pmatch, 0);
- (*lineInfo)[n].quote = classify_quote (QuoteList,
- (char *) fmt + pmatch[0].rm_so,
- pmatch[0].rm_eo - pmatch[0].rm_so,
- force_redraw, q_level);
+ (*lineInfo)[n].quote =
+ classify_quote (QuoteList,
+ (char *) fmt + pmatch[0].rm_so,
+ pmatch[0].rm_eo - pmatch[0].rm_so,
+ force_redraw, q_level);
}
if ((flags & MUTT_SEARCH) && !(*lineInfo)[n].continuation && (*lineInfo)[n].search_cnt == -1)
for (i = wrapped ? 0 : rd.topline + searchctx + 1; i < rd.lastLine; i++)
{
if ((!rd.hideQuoted || rd.lineInfo[i].type != MT_COLOR_QUOTED) &&
- !rd.lineInfo[i].continuation && rd.lineInfo[i].search_cnt > 0)
+ !rd.lineInfo[i].continuation && rd.lineInfo[i].search_cnt > 0)
break;
}
for (i = wrapped ? rd.lastLine : rd.topline + searchctx - 1; i >= 0; i--)
{
if ((!rd.hideQuoted || (rd.has_types &&
- rd.lineInfo[i].type != MT_COLOR_QUOTED)) &&
- !rd.lineInfo[i].continuation && rd.lineInfo[i].search_cnt > 0)
+ rd.lineInfo[i].type != MT_COLOR_QUOTED)) &&
+ !rd.lineInfo[i].continuation && rd.lineInfo[i].search_cnt > 0)
break;
}
/* update the search pointers */
i = 0;
while (display_line (rd.fp, &rd.last_pos, &rd.lineInfo, i, &rd.lastLine,
- &rd.maxLine, MUTT_SEARCH | (flags & MUTT_PAGER_NSKIP) | (flags & MUTT_PAGER_NOWRAP),
- &rd.QuoteList, &rd.q_level,
+ &rd.maxLine, MUTT_SEARCH | (flags & MUTT_PAGER_NSKIP) | (flags & MUTT_PAGER_NOWRAP),
+ &rd.QuoteList, &rd.q_level,
&rd.force_redraw, &rd.SearchRE, rd.pager_window) == 0)
i++;
for (i = rd.topline; i < rd.lastLine; i++)
{
if ((!rd.hideQuoted || rd.lineInfo[i].type != MT_COLOR_QUOTED) &&
- !rd.lineInfo[i].continuation && rd.lineInfo[i].search_cnt > 0)
+ !rd.lineInfo[i].continuation && rd.lineInfo[i].search_cnt > 0)
break;
}
for (i = rd.topline; i >= 0; i--)
{
if ((!rd.hideQuoted || rd.lineInfo[i].type != MT_COLOR_QUOTED) &&
- !rd.lineInfo[i].continuation && rd.lineInfo[i].search_cnt > 0)
+ !rd.lineInfo[i].continuation && rd.lineInfo[i].search_cnt > 0)
break;
}
case OP_SORT:
case OP_SORT_REVERSE:
- CHECK_MODE(IsHeader (extra))
+ CHECK_MODE(IsHeader (extra));
if (mutt_select_sort ((ch == OP_SORT_REVERSE)) == 0)
{
set_option (OPTNEEDRESORT);
i = rd.curline;
/* make sure the types are defined to the end of file */
while (display_line (rd.fp, &rd.last_pos, &rd.lineInfo, i, &rd.lastLine,
- &rd.maxLine, rd.has_types | (flags & MUTT_PAGER_NOWRAP),
- &rd.QuoteList, &rd.q_level, &rd.force_redraw,
+ &rd.maxLine, rd.has_types | (flags & MUTT_PAGER_NOWRAP),
+ &rd.QuoteList, &rd.q_level, &rd.force_redraw,
&rd.SearchRE, rd.pager_window) == 0)
i++;
rd.topline = upNLines (rd.pager_window->rows, rd.lineInfo, rd.lastLine, rd.hideQuoted);
*/
case OP_BOUNCE_MESSAGE:
- CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra))
+ CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra));
CHECK_ATTACH;
if (IsMsgAttach (extra))
mutt_attach_bounce (extra->fp, extra->hdr,
break;
case OP_RESEND:
- CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra))
+ CHECK_MODE(IsHeader (extra) || IsMsgAttach (extra));
CHECK_ATTACH;
if (IsMsgAttach (extra))
mutt_attach_resend (extra->fp, extra->hdr,
(ch == OP_SAVE) || (ch == OP_DECODE_SAVE),
(ch == OP_DECODE_SAVE) || (ch == OP_DECODE_COPY),
(ch == OP_DECRYPT_SAVE) || (ch == OP_DECRYPT_COPY) ||
- 0) == 0 && (ch == OP_SAVE || ch == OP_DECODE_SAVE
- || ch == OP_DECRYPT_SAVE
- ))
+ 0) == 0 &&
+ (ch == OP_SAVE || ch == OP_DECODE_SAVE || ch == OP_DECRYPT_SAVE)
+ )
{
if (option (OPTRESOLVE))
{
if (option (OPTRESOLVE))
{
rc = (ch == OP_DELETE_THREAD) ?
- OP_MAIN_NEXT_THREAD : OP_MAIN_NEXT_SUBTHREAD;
+ OP_MAIN_NEXT_THREAD : OP_MAIN_NEXT_SUBTHREAD;
ch = -1;
}
pager_menu->redraw = REDRAW_FULL;
break;
- case OP_EDIT_LABEL:
+ case OP_EDIT_LABEL:
CHECK_MODE(IsHeader (extra));
rc = mutt_label_message(extra->hdr);
if (rc > 0) {
new->value = safe_strdup (buffer);
dprint (2, (debugfile, "parse_parameter: `%s' = `%s'\n",
- new->attribute ? new->attribute : "",
- new->value ? new->value : ""));
+ new->attribute ? new->attribute : "",
+ new->value ? new->value : ""));
/* Add this parameter to the list */
if (head)
#ifdef SUN_ATTACHMENT
if (ascii_strcasecmp ("x-sun-attachment", s) == 0)
- ct->subtype = safe_strdup ("x-sun-attachment");
+ ct->subtype = safe_strdup ("x-sun-attachment");
#endif
if (ct->type == TYPEOTHER)
{
if (!(pc = mutt_get_parameter ("charset", ct->parameter)))
mutt_set_parameter ("charset", (AssumedCharset && *AssumedCharset) ?
- (const char *) mutt_get_default_charset ()
- : "us-ascii", &ct->parameter);
+ (const char *) mutt_get_default_charset ()
+ : "us-ascii", &ct->parameter);
}
}
case TYPEMULTIPART:
#ifdef SUN_ATTACHMENT
if ( !ascii_strcasecmp (b->subtype, "x-sun-attachment") )
- bound = "--------";
+ bound = "--------";
else
#endif
- bound = mutt_get_parameter ("boundary", b->parameter);
+ bound = mutt_get_parameter ("boundary", b->parameter);
fseeko (fp, b->offset, SEEK_SET);
b->parts = mutt_parse_multipart (fp, bound,
if (mutt_get_parameter ("content-lines", new->parameter)) {
mutt_atoi (mutt_get_parameter ("content-lines", new->parameter), &lines);
for ( ; lines; lines-- )
- if (ftello (fp) >= end_off || fgets (buffer, LONG_STRING, fp) == NULL)
- break;
+ if (ftello (fp) >= end_off || fgets (buffer, LONG_STRING, fp) == NULL)
+ break;
}
#endif
switch (ascii_tolower (line[0]))
{
case 'a':
- if (ascii_strcasecmp (line+1, "pparently-to") == 0)
- {
- e->to = rfc822_parse_adrlist (e->to, p);
- matched = 1;
- }
- else if (ascii_strcasecmp (line+1, "pparently-from") == 0)
- {
- e->from = rfc822_parse_adrlist (e->from, p);
- matched = 1;
- }
- break;
-
- case 'b':
- if (ascii_strcasecmp (line+1, "cc") == 0)
- {
- e->bcc = rfc822_parse_adrlist (e->bcc, p);
- matched = 1;
- }
- break;
-
- case 'c':
- if (ascii_strcasecmp (line+1, "c") == 0)
- {
- e->cc = rfc822_parse_adrlist (e->cc, p);
- matched = 1;
- }
- else if (ascii_strncasecmp (line + 1, "ontent-", 7) == 0)
- {
- if (ascii_strcasecmp (line+8, "type") == 0)
+ if (ascii_strcasecmp (line+1, "pparently-to") == 0)
{
- if (hdr)
- mutt_parse_content_type (p, hdr->content);
- matched = 1;
+ e->to = rfc822_parse_adrlist (e->to, p);
+ matched = 1;
}
- else if (ascii_strcasecmp (line+8, "transfer-encoding") == 0)
+ else if (ascii_strcasecmp (line+1, "pparently-from") == 0)
{
- if (hdr)
- hdr->content->encoding = mutt_check_encoding (p);
- matched = 1;
+ e->from = rfc822_parse_adrlist (e->from, p);
+ matched = 1;
}
- else if (ascii_strcasecmp (line+8, "length") == 0)
+ break;
+
+ case 'b':
+ if (ascii_strcasecmp (line+1, "cc") == 0)
{
- if (hdr)
- {
- if ((hdr->content->length = atol (p)) < 0)
- hdr->content->length = -1;
- }
- matched = 1;
+ e->bcc = rfc822_parse_adrlist (e->bcc, p);
+ matched = 1;
}
- else if (ascii_strcasecmp (line+8, "description") == 0)
+ break;
+
+ case 'c':
+ if (ascii_strcasecmp (line+1, "c") == 0)
{
- if (hdr)
- {
- mutt_str_replace (&hdr->content->description, p);
- rfc2047_decode (&hdr->content->description);
- }
- matched = 1;
+ e->cc = rfc822_parse_adrlist (e->cc, p);
+ matched = 1;
}
- else if (ascii_strcasecmp (line+8, "disposition") == 0)
+ else if (ascii_strncasecmp (line + 1, "ontent-", 7) == 0)
{
- if (hdr)
- parse_content_disposition (p, hdr->content);
- matched = 1;
+ if (ascii_strcasecmp (line+8, "type") == 0)
+ {
+ if (hdr)
+ mutt_parse_content_type (p, hdr->content);
+ matched = 1;
+ }
+ else if (ascii_strcasecmp (line+8, "transfer-encoding") == 0)
+ {
+ if (hdr)
+ hdr->content->encoding = mutt_check_encoding (p);
+ matched = 1;
+ }
+ else if (ascii_strcasecmp (line+8, "length") == 0)
+ {
+ if (hdr)
+ {
+ if ((hdr->content->length = atol (p)) < 0)
+ hdr->content->length = -1;
+ }
+ matched = 1;
+ }
+ else if (ascii_strcasecmp (line+8, "description") == 0)
+ {
+ if (hdr)
+ {
+ mutt_str_replace (&hdr->content->description, p);
+ rfc2047_decode (&hdr->content->description);
+ }
+ matched = 1;
+ }
+ else if (ascii_strcasecmp (line+8, "disposition") == 0)
+ {
+ if (hdr)
+ parse_content_disposition (p, hdr->content);
+ matched = 1;
+ }
}
- }
- break;
+ break;
case 'd':
- if (!ascii_strcasecmp ("ate", line + 1))
- {
- mutt_str_replace (&e->date, p);
- if (hdr)
- hdr->date_sent = mutt_parse_date (p, hdr);
- matched = 1;
- }
- break;
+ if (!ascii_strcasecmp ("ate", line + 1))
+ {
+ mutt_str_replace (&e->date, p);
+ if (hdr)
+ hdr->date_sent = mutt_parse_date (p, hdr);
+ matched = 1;
+ }
+ break;
case 'e':
- if (!ascii_strcasecmp ("xpires", line + 1) &&
- hdr && mutt_parse_date (p, NULL) < time (NULL))
- hdr->expired = 1;
- break;
+ if (!ascii_strcasecmp ("xpires", line + 1) &&
+ hdr && mutt_parse_date (p, NULL) < time (NULL))
+ hdr->expired = 1;
+ break;
case 'f':
- if (!ascii_strcasecmp ("rom", line + 1))
- {
- e->from = rfc822_parse_adrlist (e->from, p);
- matched = 1;
- }
- break;
+ if (!ascii_strcasecmp ("rom", line + 1))
+ {
+ e->from = rfc822_parse_adrlist (e->from, p);
+ matched = 1;
+ }
+ break;
case 'i':
- if (!ascii_strcasecmp (line+1, "n-reply-to"))
- {
- mutt_free_list (&e->in_reply_to);
- e->in_reply_to = mutt_parse_references (p, 1);
- matched = 1;
- }
- break;
+ if (!ascii_strcasecmp (line+1, "n-reply-to"))
+ {
+ mutt_free_list (&e->in_reply_to);
+ e->in_reply_to = mutt_parse_references (p, 1);
+ matched = 1;
+ }
+ break;
case 'l':
- if (!ascii_strcasecmp (line + 1, "ines"))
- {
- if (hdr)
+ if (!ascii_strcasecmp (line + 1, "ines"))
{
- /*
- * HACK - mutt has, for a very short time, produced negative
- * Lines header values. Ignore them.
- */
- if (mutt_atoi (p, &hdr->lines) < 0 || hdr->lines < 0)
- hdr->lines = 0;
+ if (hdr)
+ {
+ /*
+ * HACK - mutt has, for a very short time, produced negative
+ * Lines header values. Ignore them.
+ */
+ if (mutt_atoi (p, &hdr->lines) < 0 || hdr->lines < 0)
+ hdr->lines = 0;
+ }
+
+ matched = 1;
}
-
- matched = 1;
- }
- else if (!ascii_strcasecmp (line + 1, "ist-Post"))
- {
- /* RFC 2369. FIXME: We should ignore whitespace, but don't. */
- if (strncmp (p, "NO", 2))
+ else if (!ascii_strcasecmp (line + 1, "ist-Post"))
{
- char *beg, *end;
- for (beg = strchr (p, '<'); beg; beg = strchr (end, ','))
- {
- ++beg;
- if (!(end = strchr (beg, '>')))
- break;
-
- /* Take the first mailto URL */
- if (url_check_scheme (beg) == U_MAILTO)
- {
- FREE (&e->list_post);
- e->list_post = mutt_substrdup (beg, end);
- if (option (OPTAUTOSUBSCRIBE))
- mutt_auto_subscribe (e->list_post);
- break;
- }
- }
+ /* RFC 2369. FIXME: We should ignore whitespace, but don't. */
+ if (strncmp (p, "NO", 2))
+ {
+ char *beg, *end;
+ for (beg = strchr (p, '<'); beg; beg = strchr (end, ','))
+ {
+ ++beg;
+ if (!(end = strchr (beg, '>')))
+ break;
+
+ /* Take the first mailto URL */
+ if (url_check_scheme (beg) == U_MAILTO)
+ {
+ FREE (&e->list_post);
+ e->list_post = mutt_substrdup (beg, end);
+ if (option (OPTAUTOSUBSCRIBE))
+ mutt_auto_subscribe (e->list_post);
+ break;
+ }
+ }
+ }
+ matched = 1;
}
- matched = 1;
- }
- break;
+ break;
case 'm':
- if (!ascii_strcasecmp (line + 1, "ime-version"))
- {
- if (hdr)
- hdr->mime = 1;
- matched = 1;
- }
- else if (!ascii_strcasecmp (line + 1, "essage-id"))
- {
- /* We add a new "Message-ID:" when building a message */
- FREE (&e->message_id);
- e->message_id = mutt_extract_message_id (p, NULL);
- matched = 1;
- }
- else if (!ascii_strncasecmp (line + 1, "ail-", 4))
- {
- if (!ascii_strcasecmp (line + 5, "reply-to"))
+ if (!ascii_strcasecmp (line + 1, "ime-version"))
{
- /* override the Reply-To: field */
- rfc822_free_address (&e->reply_to);
- e->reply_to = rfc822_parse_adrlist (e->reply_to, p);
- matched = 1;
+ if (hdr)
+ hdr->mime = 1;
+ matched = 1;
}
- else if (!ascii_strcasecmp (line + 5, "followup-to"))
+ else if (!ascii_strcasecmp (line + 1, "essage-id"))
{
- e->mail_followup_to = rfc822_parse_adrlist (e->mail_followup_to, p);
- matched = 1;
+ /* We add a new "Message-ID:" when building a message */
+ FREE (&e->message_id);
+ e->message_id = mutt_extract_message_id (p, NULL);
+ matched = 1;
}
- }
- break;
+ else if (!ascii_strncasecmp (line + 1, "ail-", 4))
+ {
+ if (!ascii_strcasecmp (line + 5, "reply-to"))
+ {
+ /* override the Reply-To: field */
+ rfc822_free_address (&e->reply_to);
+ e->reply_to = rfc822_parse_adrlist (e->reply_to, p);
+ matched = 1;
+ }
+ else if (!ascii_strcasecmp (line + 5, "followup-to"))
+ {
+ e->mail_followup_to = rfc822_parse_adrlist (e->mail_followup_to, p);
+ matched = 1;
+ }
+ }
+ break;
case 'r':
- if (!ascii_strcasecmp (line + 1, "eferences"))
- {
- mutt_free_list (&e->references);
- e->references = mutt_parse_references (p, 0);
- matched = 1;
- }
- else if (!ascii_strcasecmp (line + 1, "eply-to"))
- {
- e->reply_to = rfc822_parse_adrlist (e->reply_to, p);
- matched = 1;
- }
- else if (!ascii_strcasecmp (line + 1, "eturn-path"))
- {
- e->return_path = rfc822_parse_adrlist (e->return_path, p);
- matched = 1;
- }
- else if (!ascii_strcasecmp (line + 1, "eceived"))
- {
- if (hdr && !hdr->received)
+ if (!ascii_strcasecmp (line + 1, "eferences"))
+ {
+ mutt_free_list (&e->references);
+ e->references = mutt_parse_references (p, 0);
+ matched = 1;
+ }
+ else if (!ascii_strcasecmp (line + 1, "eply-to"))
{
- char *d = strrchr (p, ';');
+ e->reply_to = rfc822_parse_adrlist (e->reply_to, p);
+ matched = 1;
+ }
+ else if (!ascii_strcasecmp (line + 1, "eturn-path"))
+ {
+ e->return_path = rfc822_parse_adrlist (e->return_path, p);
+ matched = 1;
+ }
+ else if (!ascii_strcasecmp (line + 1, "eceived"))
+ {
+ if (hdr && !hdr->received)
+ {
+ char *d = strrchr (p, ';');
- if (d)
- hdr->received = mutt_parse_date (d + 1, NULL);
+ if (d)
+ hdr->received = mutt_parse_date (d + 1, NULL);
+ }
}
- }
- break;
+ break;
case 's':
- if (!ascii_strcasecmp (line + 1, "ubject"))
- {
- if (!e->subject)
- e->subject = safe_strdup (p);
- matched = 1;
- }
- else if (!ascii_strcasecmp (line + 1, "ender"))
- {
- e->sender = rfc822_parse_adrlist (e->sender, p);
- matched = 1;
- }
- else if (!ascii_strcasecmp (line + 1, "tatus"))
- {
- if (hdr)
+ if (!ascii_strcasecmp (line + 1, "ubject"))
{
- while (*p)
- {
- switch(*p)
- {
- case 'r':
- hdr->replied = 1;
- break;
- case 'O':
- hdr->old = 1;
- break;
- case 'R':
- hdr->read = 1;
- break;
- }
- p++;
- }
+ if (!e->subject)
+ e->subject = safe_strdup (p);
+ matched = 1;
}
- matched = 1;
- }
- else if ((!ascii_strcasecmp ("upersedes", line + 1) ||
- !ascii_strcasecmp ("upercedes", line + 1)) && hdr)
- {
- FREE(&e->supersedes);
- e->supersedes = safe_strdup (p);
- }
- break;
+ else if (!ascii_strcasecmp (line + 1, "ender"))
+ {
+ e->sender = rfc822_parse_adrlist (e->sender, p);
+ matched = 1;
+ }
+ else if (!ascii_strcasecmp (line + 1, "tatus"))
+ {
+ if (hdr)
+ {
+ while (*p)
+ {
+ switch(*p)
+ {
+ case 'r':
+ hdr->replied = 1;
+ break;
+ case 'O':
+ hdr->old = 1;
+ break;
+ case 'R':
+ hdr->read = 1;
+ break;
+ }
+ p++;
+ }
+ }
+ matched = 1;
+ }
+ else if ((!ascii_strcasecmp ("upersedes", line + 1) ||
+ !ascii_strcasecmp ("upercedes", line + 1)) && hdr)
+ {
+ FREE(&e->supersedes);
+ e->supersedes = safe_strdup (p);
+ }
+ break;
case 't':
- if (ascii_strcasecmp (line+1, "o") == 0)
- {
- e->to = rfc822_parse_adrlist (e->to, p);
- matched = 1;
- }
- break;
+ if (ascii_strcasecmp (line+1, "o") == 0)
+ {
+ e->to = rfc822_parse_adrlist (e->to, p);
+ matched = 1;
+ }
+ break;
case 'x':
- if (ascii_strcasecmp (line+1, "-status") == 0)
- {
- if (hdr)
+ if (ascii_strcasecmp (line+1, "-status") == 0)
{
- while (*p)
- {
- switch (*p)
- {
- case 'A':
- hdr->replied = 1;
- break;
- case 'D':
- hdr->deleted = 1;
- break;
- case 'F':
- hdr->flagged = 1;
- break;
- default:
- break;
- }
- p++;
- }
+ if (hdr)
+ {
+ while (*p)
+ {
+ switch (*p)
+ {
+ case 'A':
+ hdr->replied = 1;
+ break;
+ case 'D':
+ hdr->deleted = 1;
+ break;
+ case 'F':
+ hdr->flagged = 1;
+ break;
+ default:
+ break;
+ }
+ p++;
+ }
+ }
+ matched = 1;
+ }
+ else if (ascii_strcasecmp (line+1, "-label") == 0)
+ {
+ FREE(&e->x_label);
+ e->x_label = safe_strdup(p);
+ matched = 1;
}
- matched = 1;
- }
- else if (ascii_strcasecmp (line+1, "-label") == 0)
- {
- FREE(&e->x_label);
- e->x_label = safe_strdup(p);
- matched = 1;
- }
default:
- break;
+ break;
}
/* Keep track of the user-defined headers */
*lastp = last;
}
- done:
+done:
return matched;
}
}
while ((loc = ftello (f)),
- *(line = mutt_read_rfc822_line (f, line, &linelen)) != 0)
+ *(line = mutt_read_rfc822_line (f, line, &linelen)) != 0)
{
if ((p = strpbrk (line, ": \t")) == NULL || *p != ':')
{
{
a = (ATTACH_MATCH *)type->data;
dprint(5, (debugfile, "cbpc: %s %d/%s ?? %s/%s [%d]... ",
- dflt ? "[OK] " : "[EXCL] ",
- b->type, b->subtype, a->major, a->minor, a->major_int));
+ dflt ? "[OK] " : "[EXCL] ",
+ b->type, b->subtype, a->major, a->minor, a->major_int));
if ((a->major_int == TYPEANY || a->major_int == b->type) &&
!regexec(&a->minor_rx, b->subtype, 0, NULL, 0))
{
shallrecurse = 0;
dprint(5, (debugfile, "bp: desc=\"%s\"; fn=\"%s\", type=\"%d/%s\"\n",
- bp->description ? bp->description : ("none"),
- bp->filename ? bp->filename :
- bp->d_filename ? bp->d_filename : "(none)",
- bp->type, bp->subtype ? bp->subtype : "*"));
+ bp->description ? bp->description : ("none"),
+ bp->filename ? bp->filename :
+ bp->d_filename ? bp->d_filename : "(none)",
+ bp->type, bp->subtype ? bp->subtype : "*"));
if (bp->type == TYPEMESSAGE)
{
if (min->tm_year > max->tm_year
|| (min->tm_year == max->tm_year && min->tm_mon > max->tm_mon)
|| (min->tm_year == max->tm_year && min->tm_mon == max->tm_mon
- && min->tm_mday > max->tm_mday))
+ && min->tm_mday > max->tm_mday))
{
int tmp;
}
static const char * parse_date_range (const char* pc, struct tm *min,
- struct tm *max, int haveMin, struct tm *baseMin, BUFFER *err)
+ struct tm *max, int haveMin,
+ struct tm *baseMin, BUFFER *err)
{
int flag = MUTT_PDR_NONE;
while (*pc && ((flag & MUTT_PDR_DONE) == 0))
{
if (pat->stringmatch)
return pat->ign_case ? !strcasestr (buf, pat->p.str) :
- !strstr (buf, pat->p.str);
+ !strstr (buf, pat->p.str);
else if (pat->groupmatch)
return !mutt_group_match (pat->p.g, buf);
else
return (pat->not ^ h->deleted);
case MUTT_MESSAGE:
return (pat->not ^ (h->msgno >= pat->min - 1 && (pat->max == MUTT_MAXRANGE ||
- h->msgno <= pat->max - 1)));
+ h->msgno <= pat->max - 1)));
case MUTT_DATE:
if (pat->dynamic)
match_update_dynamic_date (pat);
* This is also the case when message scoring.
*/
if (!ctx)
- return 0;
+ return 0;
#ifdef USE_IMAP
/* IMAP search sets h->matched at search compile time */
if (ctx->magic == MUTT_IMAP && pat->stringmatch)
h->env->from, h->env->sender,
h->env->to, h->env->cc));
case MUTT_RECIPIENT:
- return (pat->not ^ match_adrlist (pat, flags & MUTT_MATCH_FULL_ADDRESS,
- 2, h->env->to, h->env->cc));
+ return (pat->not ^ match_adrlist (pat, flags & MUTT_MATCH_FULL_ADDRESS,
+ 2, h->env->to, h->env->cc));
case MUTT_LIST: /* known list, subscribed or not */
if (cache)
{
return (pat->not ^ result);
case MUTT_COLLAPSED:
return (pat->not ^ (h->collapsed && h->num_hidden > 1));
- case MUTT_CRYPT_SIGN:
- if (!WithCrypto)
- break;
- return (pat->not ^ ((h->security & SIGN) ? 1 : 0));
- case MUTT_CRYPT_VERIFIED:
- if (!WithCrypto)
- break;
- return (pat->not ^ ((h->security & GOODSIGN) ? 1 : 0));
- case MUTT_CRYPT_ENCRYPT:
- if (!WithCrypto)
- break;
- return (pat->not ^ ((h->security & ENCRYPT) ? 1 : 0));
- case MUTT_PGP_KEY:
- if (!(WithCrypto & APPLICATION_PGP))
- break;
- return (pat->not ^ ((h->security & PGPKEY) == PGPKEY));
+ case MUTT_CRYPT_SIGN:
+ if (!WithCrypto)
+ break;
+ return (pat->not ^ ((h->security & SIGN) ? 1 : 0));
+ case MUTT_CRYPT_VERIFIED:
+ if (!WithCrypto)
+ break;
+ return (pat->not ^ ((h->security & GOODSIGN) ? 1 : 0));
+ case MUTT_CRYPT_ENCRYPT:
+ if (!WithCrypto)
+ break;
+ return (pat->not ^ ((h->security & ENCRYPT) ? 1 : 0));
+ case MUTT_PGP_KEY:
+ if (!(WithCrypto & APPLICATION_PGP))
+ break;
+ return (pat->not ^ ((h->security & PGPKEY) == PGPKEY));
case MUTT_XLABEL:
return (pat->not ^ (h->env->x_label && patmatch (pat, h->env->x_label) == 0));
case MUTT_HORMEL:
if (!ctx)
return 0;
{
- int count = mutt_count_body_parts (ctx, h);
- return (pat->not ^ (count >= pat->min && (pat->max == MUTT_MAXRANGE ||
- count <= pat->max)));
+ int count = mutt_count_body_parts (ctx, h);
+ return (pat->not ^ (count >= pat->min && (pat->max == MUTT_MAXRANGE ||
+ count <= pat->max)));
}
case MUTT_MIMETYPE:
if (!ctx)
Context->v2r[Context->vcount] = i;
Context->vcount++;
Context->vsize += this_body->length + this_body->offset -
- this_body->hdr_offset + padding;
+ this_body->hdr_offset + padding;
}
}
}
0);
case MUTT_DELETE:
mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], MUTT_DELETE,
- (op == MUTT_DELETE));
+ (op == MUTT_DELETE));
break;
case MUTT_TAG:
case MUTT_UNTAG:
if (mutt_get_field ((op == OP_SEARCH || op == OP_SEARCH_NEXT) ?
_("Search for: ") : _("Reverse search for: "),
buf, sizeof (buf),
- MUTT_CLEAR | MUTT_PATTERN) != 0 || !buf[0])
+ MUTT_CLEAR | MUTT_PATTERN) != 0 || !buf[0])
return (-1);
if (op == OP_SEARCH || op == OP_SEARCH_NEXT)
time_t now = time (NULL);
if (pgp_use_gpg_agent())
- {
- *PgpPass = 0;
- return 1; /* handled by gpg-agent */
- }
+ {
+ *PgpPass = 0;
+ return 1; /* handled by gpg-agent */
+ }
if (now < PgpExptime)
/* Use cached copy. */
pgp_void_passphrase ();
if (mutt_get_password (_("Enter PGP passphrase:"), PgpPass, sizeof (PgpPass)) == 0)
- {
- PgpExptime = mutt_add_timeout (time (NULL), PgpTimeout);
- return (1);
- }
+ {
+ PgpExptime = mutt_add_timeout (time (NULL), PgpTimeout);
+ return (1);
+ }
else
PgpExptime = 0;
continue;
s = line + 9;
dprint (2, (debugfile, "pgp_check_decryption_okay: checking \"%s\".\n",
- line));
+ line));
if (mutt_strncmp (s, "BEGIN_DECRYPTION", 16) == 0)
inside_decrypt = 1;
else if (mutt_strncmp (s, "END_DECRYPTION", 14) == 0)
crypt_current_time (s, "PGP");
if((thepid = pgp_invoke_verify (NULL, &pgpout, NULL,
- -1, -1, fileno(pgperr),
- tempfile, sigfile)) != -1)
+ -1, -1, fileno(pgperr),
+ tempfile, sigfile)) != -1)
{
if (pgp_copy_checksig (pgpout, s->fpout) >= 0)
badsig = 0;
if ((rv = mutt_wait_filter (thepid)))
badsig = -1;
- dprint (1, (debugfile, "pgp_verify_one: mutt_wait_filter returned %d.\n", rv));
+ dprint (1, (debugfile, "pgp_verify_one: mutt_wait_filter returned %d.\n", rv));
}
safe_fclose (&pgperr);
}
if (!pgp_use_gpg_agent())
- fputs(PgpPass, pgpin);
+ fputs(PgpPass, pgpin);
fputc('\n', pgpin);
safe_fclose (&pgpin);
{
snprintf (buf, sizeof (buf), _("Enter keyID for %s: "), q->mailbox);
k_info = pgp_ask_for_key (buf, q->mailbox,
- KEYFLAG_CANENCRYPT, PGP_PUBRING);
+ KEYFLAG_CANENCRYPT, PGP_PUBRING);
}
if (k_info == NULL)
keylist_size += mutt_strlen (keyID) + 4;
safe_realloc (&keylist, keylist_size);
sprintf (keylist + keylist_used, "%s0x%s", keylist_used ? " " : "", /* __SPRINTF_CHECKED__ */
- keyID);
+ keyID);
keylist_used = mutt_strlen (keylist);
key_selected = 1;
if (sign)
{
if (!pgp_use_gpg_agent())
- fputs (PgpPass, pgpin);
+ fputs (PgpPass, pgpin);
fputc ('\n', pgpin);
}
safe_fclose (&pgpin);
if (msg->security & (ENCRYPT | SIGN))
{
snprintf (promptbuf, sizeof (promptbuf),
- _("PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off? "),
- (msg->security & INLINE) ? _("PGP/M(i)ME") : _("(i)nline"));
+ _("PGP (s)ign, sign (a)s, %s format, (c)lear, or (o)ppenc mode off? "),
+ (msg->security & INLINE) ? _("PGP/M(i)ME") : _("(i)nline"));
prompt = promptbuf;
/* L10N: The 'f' is from "forget it", an old undocumented synonym of
'clear'. Please use a corresponding letter in your language.
else if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
{
/* 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 & (ENCRYPT | SIGN))
{
snprintf (promptbuf, sizeof (promptbuf),
- _("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode? "),
- (msg->security & INLINE) ? _("PGP/M(i)ME") : _("(i)nline"));
+ _("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, (c)lear, or (o)ppenc mode? "),
+ (msg->security & INLINE) ? _("PGP/M(i)ME") : _("(i)nline"));
prompt = promptbuf;
letters = _("esabfcoi");
choices = "esabfcOi";
{
snprintf (promptbuf, sizeof (promptbuf),
- _("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear? "),
- (msg->security & INLINE) ? _("PGP/M(i)ME") : _("(i)nline"));
+ _("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s format, or (c)lear? "),
+ (msg->security & INLINE) ? _("PGP/M(i)ME") : _("(i)nline"));
prompt = promptbuf;
letters = _("esabfci");
choices = "esabfci";
{
switch (choices[choice - 1])
{
- case 'e': /* (e)ncrypt */
- msg->security |= ENCRYPT;
- msg->security &= ~SIGN;
- break;
+ case 'e': /* (e)ncrypt */
+ msg->security |= ENCRYPT;
+ msg->security &= ~SIGN;
+ break;
- case 's': /* (s)ign */
- msg->security &= ~ENCRYPT;
- msg->security |= SIGN;
- break;
+ case 's': /* (s)ign */
+ msg->security &= ~ENCRYPT;
+ msg->security |= SIGN;
+ break;
- case 'S': /* (s)ign in oppenc mode */
- msg->security |= SIGN;
- break;
+ case 'S': /* (s)ign in oppenc mode */
+ msg->security |= SIGN;
+ break;
- case 'a': /* sign (a)s */
- unset_option(OPTPGPCHECKTRUST);
+ case 'a': /* sign (a)s */
+ unset_option(OPTPGPCHECKTRUST);
- if ((p = pgp_ask_for_key (_("Sign as: "), NULL, 0, PGP_SECRING)))
- {
- snprintf (input_signas, sizeof (input_signas), "0x%s",
- pgp_fpr_or_lkeyid (p));
- mutt_str_replace (&PgpSignAs, input_signas);
- pgp_free_key (&p);
+ if ((p = pgp_ask_for_key (_("Sign as: "), NULL, 0, PGP_SECRING)))
+ {
+ snprintf (input_signas, sizeof (input_signas), "0x%s",
+ pgp_fpr_or_lkeyid (p));
+ mutt_str_replace (&PgpSignAs, input_signas);
+ pgp_free_key (&p);
- msg->security |= SIGN;
+ msg->security |= SIGN;
- crypt_pgp_void_passphrase (); /* probably need a different passphrase */
- }
- break;
+ crypt_pgp_void_passphrase (); /* probably need a different passphrase */
+ }
+ break;
- case 'b': /* (b)oth */
- msg->security |= (ENCRYPT | SIGN);
- break;
+ case 'b': /* (b)oth */
+ msg->security |= (ENCRYPT | SIGN);
+ break;
- case 'f': /* (f)orget it: kept for backward compatibility. */
- case 'c': /* (c)lear */
- msg->security &= ~(ENCRYPT | SIGN);
- break;
+ case 'f': /* (f)orget it: kept for backward compatibility. */
+ case 'c': /* (c)lear */
+ msg->security &= ~(ENCRYPT | SIGN);
+ break;
- case 'F': /* (f)orget it or (c)lear in oppenc mode */
- case 'C':
- msg->security &= ~SIGN;
- break;
+ case 'F': /* (f)orget it or (c)lear in oppenc mode */
+ case 'C':
+ msg->security &= ~SIGN;
+ break;
- case 'O': /* oppenc mode on */
- msg->security |= OPPENCRYPT;
- crypt_opportunistic_encrypt (msg);
- break;
+ case 'O': /* oppenc mode on */
+ msg->security |= OPPENCRYPT;
+ crypt_opportunistic_encrypt (msg);
+ break;
- case 'o': /* oppenc mode off */
- msg->security &= ~OPPENCRYPT;
- break;
+ case 'o': /* oppenc mode off */
+ msg->security &= ~OPPENCRYPT;
+ break;
- case 'i': /* toggle (i)nline */
- msg->security ^= INLINE;
- break;
+ case 'i': /* toggle (i)nline */
+ msg->security ^= INLINE;
+ break;
}
}
int pgpinfd, int pgpoutfd, int pgperrfd,
pgp_ring_t keyring, LIST *hints);
pid_t pgp_invoke_traditional (FILE **pgpin, FILE **pgpout, FILE **pgperr,
- int pgpinfd, int pgpoutfd, int pgperrfd,
- const char *fname, const char *uids, int flags);
+ int pgpinfd, int pgpoutfd, int pgperrfd,
+ const char *fname, const char *uids, int flags);
void pgp_invoke_import (const char *fname);
#include <string.h>
void print_usage(const char *progname) {
- fprintf(stderr, "Command line usage: %s [flags] -- prefix [recipients]\n", progname);
- exit(1);
+ fprintf(stderr, "Command line usage: %s [flags] -- prefix [recipients]\n", progname);
+ exit(1);
}
int main(int argc, char **argv) {
- char **opts, **opt, *pfx;
- int i;
+ char **opts, **opt, *pfx;
+ int i;
- if (argc <= 1) {
- print_usage(argv[0]);
- }
+ if (argc <= 1) {
+ print_usage(argv[0]);
+ }
- opts = malloc((2 * argc + 1) * sizeof (* opts)); /* __MEM_CHECKED__ */
- if(!opts) {
- perror(argv[0]);
- exit(2);
- }
+ opts = malloc((2 * argc + 1) * sizeof (* opts)); /* __MEM_CHECKED__ */
+ if(!opts) {
+ perror(argv[0]);
+ exit(2);
+ }
- if (argc < 2)
- {
- fprintf (stderr,
- "Command line usage: %s [flags] -- prefix [recipients]\n",
- argv[0]);
- return 1;
- }
+ if (argc < 2)
+ {
+ fprintf (stderr,
+ "Command line usage: %s [flags] -- prefix [recipients]\n",
+ argv[0]);
+ return 1;
+ }
- opt = opts;
- *opt++ = argv[1];
- pfx = NULL;
+ opt = opts;
+ *opt++ = argv[1];
+ pfx = NULL;
- for(i = 2; i < argc; ) {
- if(!strcmp(argv[i], "--")) {
- i += 2;
- if(i > argc) {
- print_usage(argv[0]);
- }
- pfx = argv[i-1];
- }
- if(pfx)
- *opt++ = pfx;
- *opt++ = argv[i++];
- }
- *opt = NULL;
+ for(i = 2; i < argc; ) {
+ if(!strcmp(argv[i], "--")) {
+ i += 2;
+ if(i > argc) {
+ print_usage(argv[0]);
+ }
+ pfx = argv[i-1];
+ }
+ if(pfx)
+ *opt++ = pfx;
+ *opt++ = argv[i++];
+ }
+ *opt = NULL;
- execvp(opts[0], opts);
- perror(argv[0]);
- return 2;
+ execvp(opts[0], opts);
+ perror(argv[0]);
+ return 2;
}
mutt_pgp_command (cmd, sizeof (cmd), &cctx, format);
return mutt_create_filter_fd (cmd, pgpin, pgpout, pgperr,
- pgpinfd, pgpoutfd, pgperrfd);
+ pgpinfd, pgpoutfd, pgperrfd);
}
rc = pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd,
0, NULL, NULL, mutt_b2s (uids),
- keyring == PGP_SECRING ? PgpListSecringCommand :
- PgpListPubringCommand);
+ keyring == PGP_SECRING ? PgpListSecringCommand :
+ PgpListPubringCommand);
mutt_buffer_pool_release (&uids);
return rc;
{
case '[':
+ {
+ const char *cp;
+ char buf2[SHORT_STRING], *p;
+ int do_locales;
+ struct tm *tm;
+ size_t len;
+
+ p = dest;
+
+ cp = src;
+ if (*cp == '!')
{
- const char *cp;
- char buf2[SHORT_STRING], *p;
- int do_locales;
- struct tm *tm;
- size_t len;
-
- p = dest;
-
- cp = src;
- if (*cp == '!')
- {
- do_locales = 0;
- cp++;
- }
- else
- do_locales = 1;
-
- len = destlen - 1;
- while (len > 0 && *cp != ']')
- {
- if (*cp == '%')
- {
- cp++;
- if (len >= 2)
- {
- *p++ = '%';
- *p++ = *cp;
- len -= 2;
- }
- else
- break; /* not enough space */
- cp++;
- }
- else
- {
- *p++ = *cp++;
- len--;
- }
- }
- *p = 0;
-
-
- tm = localtime (&key->gen_time);
-
- if (!do_locales)
- setlocale (LC_TIME, "C");
- strftime (buf2, sizeof (buf2), dest, tm);
- if (!do_locales)
- setlocale (LC_TIME, "");
+ do_locales = 0;
+ cp++;
+ }
+ else
+ do_locales = 1;
- snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
- snprintf (dest, destlen, fmt, buf2);
- if (len > 0)
- src = cp + 1;
+ len = destlen - 1;
+ while (len > 0 && *cp != ']')
+ {
+ if (*cp == '%')
+ {
+ cp++;
+ if (len >= 2)
+ {
+ *p++ = '%';
+ *p++ = *cp;
+ len -= 2;
+ }
+ else
+ break; /* not enough space */
+ cp++;
+ }
+ else
+ {
+ *p++ = *cp++;
+ len--;
+ }
}
- break;
+ *p = 0;
+
+
+ tm = localtime (&key->gen_time);
+
+ if (!do_locales)
+ setlocale (LC_TIME, "C");
+ strftime (buf2, sizeof (buf2), dest, tm);
+ if (!do_locales)
+ setlocale (LC_TIME, "");
+
+ snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
+ snprintf (dest, destlen, fmt, buf2);
+ if (len > 0)
+ src = cp + 1;
+ }
+ break;
case 'n':
if (!optional)
{
static int pgp_compare_address (const void *a, const void *b)
{
return ((PgpSortKeys & SORT_REVERSE) ? !_pgp_compare_address (a, b)
- : _pgp_compare_address (a, b));
+ : _pgp_compare_address (a, b));
}
static int pgp_compare_keyid (const void *a, const void *b)
{
return ((PgpSortKeys & SORT_REVERSE) ? !_pgp_compare_keyid (a, b)
- : _pgp_compare_keyid (a, b));
+ : _pgp_compare_keyid (a, b));
}
static int _pgp_compare_date (const void *a, const void *b)
static int pgp_compare_date (const void *a, const void *b)
{
return ((PgpSortKeys & SORT_REVERSE) ? !_pgp_compare_date (a, b)
- : _pgp_compare_date (a, b));
+ : _pgp_compare_date (a, b));
}
static int _pgp_compare_trust (const void *a, const void *b)
static int pgp_compare_trust (const void *a, const void *b)
{
return ((PgpSortKeys & SORT_REVERSE) ? !_pgp_compare_trust (a, b)
- : _pgp_compare_trust (a, b));
+ : _pgp_compare_trust (a, b));
}
static int pgp_key_is_valid (pgp_key_t k)
switch (mutt_menuLoop (menu))
{
- case OP_VERIFY_KEY:
+ case OP_VERIFY_KEY:
- mutt_mktemp (tempfile, sizeof (tempfile));
- if ((devnull = fopen ("/dev/null", "w")) == NULL) /* __FOPEN_CHECKED__ */
- {
- mutt_perror _("Can't open /dev/null");
- break;
- }
- if ((fp = safe_fopen (tempfile, "w")) == NULL)
- {
- safe_fclose (&devnull);
- mutt_perror _("Can't create temporary file");
- break;
- }
+ mutt_mktemp (tempfile, sizeof (tempfile));
+ if ((devnull = fopen ("/dev/null", "w")) == NULL) /* __FOPEN_CHECKED__ */
+ {
+ mutt_perror _("Can't open /dev/null");
+ break;
+ }
+ if ((fp = safe_fopen (tempfile, "w")) == NULL)
+ {
+ safe_fclose (&devnull);
+ mutt_perror _("Can't create temporary file");
+ break;
+ }
- mutt_message _("Invoking PGP...");
+ mutt_message _("Invoking PGP...");
- snprintf (tmpbuf, sizeof (tmpbuf), "0x%s",
- pgp_fpr_or_lkeyid (pgp_principal_key (KeyTable[menu->current]->parent)));
+ snprintf (tmpbuf, sizeof (tmpbuf), "0x%s",
+ pgp_fpr_or_lkeyid (pgp_principal_key (KeyTable[menu->current]->parent)));
- if ((thepid = pgp_invoke_verify_key (NULL, NULL, NULL, -1,
- fileno (fp), fileno (devnull), tmpbuf)) == -1)
- {
- mutt_perror _("Can't create filter");
- unlink (tempfile);
- safe_fclose (&fp);
- safe_fclose (&devnull);
- }
+ if ((thepid = pgp_invoke_verify_key (NULL, NULL, NULL, -1,
+ fileno (fp), fileno (devnull), tmpbuf)) == -1)
+ {
+ mutt_perror _("Can't create filter");
+ unlink (tempfile);
+ safe_fclose (&fp);
+ safe_fclose (&devnull);
+ }
- mutt_wait_filter (thepid);
- safe_fclose (&fp);
- safe_fclose (&devnull);
- mutt_clear_error ();
- snprintf (cmd, sizeof (cmd), _("Key ID: 0x%s"),
- pgp_keyid (pgp_principal_key (KeyTable[menu->current]->parent)));
- mutt_do_pager (cmd, tempfile, 0, NULL);
- menu->redraw = REDRAW_FULL;
+ mutt_wait_filter (thepid);
+ safe_fclose (&fp);
+ safe_fclose (&devnull);
+ mutt_clear_error ();
+ snprintf (cmd, sizeof (cmd), _("Key ID: 0x%s"),
+ pgp_keyid (pgp_principal_key (KeyTable[menu->current]->parent)));
+ mutt_do_pager (cmd, tempfile, 0, NULL);
+ menu->redraw = REDRAW_FULL;
- break;
+ break;
- case OP_VIEW_ID:
+ case OP_VIEW_ID:
- mutt_message ("%s", NONULL (KeyTable[menu->current]->addr));
- break;
+ mutt_message ("%s", NONULL (KeyTable[menu->current]->addr));
+ break;
- case OP_GENERIC_SELECT_ENTRY:
+ case OP_GENERIC_SELECT_ENTRY:
- /* XXX make error reporting more verbose */
+ /* XXX make error reporting more verbose */
- if (option (OPTPGPCHECKTRUST))
- if (!pgp_key_is_valid (KeyTable[menu->current]->parent))
- {
- mutt_error _("This key can't be used: expired/disabled/revoked.");
- break;
- }
+ if (option (OPTPGPCHECKTRUST))
+ if (!pgp_key_is_valid (KeyTable[menu->current]->parent))
+ {
+ mutt_error _("This key can't be used: expired/disabled/revoked.");
+ break;
+ }
- if (option (OPTPGPCHECKTRUST) &&
- (!pgp_id_is_valid (KeyTable[menu->current])
- || !pgp_id_is_strong (KeyTable[menu->current])))
- {
- char *s = "";
- char buff[LONG_STRING];
-
- if (KeyTable[menu->current]->flags & KEYFLAG_CANTUSE)
- s = N_("ID is expired/disabled/revoked.");
- else switch (KeyTable[menu->current]->trust & 0x03)
- {
- case 0:
- s = N_("ID has undefined validity.");
- break;
- case 1:
- s = N_("ID is not valid.");
- break;
- case 2:
- s = N_("ID is only marginally valid.");
- break;
- }
-
- snprintf (buff, sizeof (buff), _("%s Do you really want to use the key?"),
- _(s));
-
- if (mutt_yesorno (buff, MUTT_NO) != MUTT_YES)
- {
- mutt_clear_error ();
- break;
- }
- }
+ if (option (OPTPGPCHECKTRUST) &&
+ (!pgp_id_is_valid (KeyTable[menu->current])
+ || !pgp_id_is_strong (KeyTable[menu->current])))
+ {
+ char *s = "";
+ char buff[LONG_STRING];
+
+ if (KeyTable[menu->current]->flags & KEYFLAG_CANTUSE)
+ s = N_("ID is expired/disabled/revoked.");
+ else switch (KeyTable[menu->current]->trust & 0x03)
+ {
+ case 0:
+ s = N_("ID has undefined validity.");
+ break;
+ case 1:
+ s = N_("ID is not valid.");
+ break;
+ case 2:
+ s = N_("ID is only marginally valid.");
+ break;
+ }
+
+ snprintf (buff, sizeof (buff), _("%s Do you really want to use the key?"),
+ _(s));
+
+ if (mutt_yesorno (buff, MUTT_NO) != MUTT_YES)
+ {
+ mutt_clear_error ();
+ break;
+ }
+ }
# if 0
- kp = pgp_principal_key (KeyTable[menu->current]->parent);
+ kp = pgp_principal_key (KeyTable[menu->current]->parent);
# else
- kp = KeyTable[menu->current]->parent;
+ kp = KeyTable[menu->current]->parent;
# endif
- done = 1;
- break;
+ done = 1;
+ break;
- case OP_EXIT:
+ case OP_EXIT:
- kp = NULL;
- done = 1;
- break;
+ kp = NULL;
+ done = 1;
+ break;
}
}
if ((thepid =
pgp_invoke_export (NULL, NULL, NULL, -1,
- fileno (tempfp), fileno (devnull), tmp)) == -1)
+ fileno (tempfp), fileno (devnull), tmp)) == -1)
{
mutt_perror _("Can't create filter");
unlink (tempf);
return hints;
for (t = strtok (scratch, " ,.:\"()<>\n"); t;
- t = strtok (NULL, " ,.:\"()<>\n"))
+ t = strtok (NULL, " ,.:\"()<>\n"))
{
if (strlen (t) > 3)
hints = mutt_add_list (hints, t);
{
switch (type)
{
- case 1:
- return "RSA";
- case 2:
- return "RSA";
- case 3:
- return "RSA";
- case 16:
- return "ElG";
- case 17:
- return "DSA";
- case 20:
- return "ElG";
- default:
- return "unk";
+ case 1:
+ return "RSA";
+ case 2:
+ return "RSA";
+ case 3:
+ return "RSA";
+ case 16:
+ return "ElG";
+ case 17:
+ return "DSA";
+ case 20:
+ return "ElG";
+ default:
+ return "unk";
}
}
{
switch (type)
{
- case 1:
- return "MD5";
- case 2:
- return "SHA1";
- case 3:
- return "RIPE-MD/160";
- case 4:
- return "HAVAL";
- default:
- return "unknown";
+ case 1:
+ return "MD5";
+ case 2:
+ return "SHA1";
+ case 3:
+ return "RIPE-MD/160";
+ case 4:
+ return "HAVAL";
+ default:
+ return "unknown";
}
}
{
switch (type)
{
- case 1:
- case 2:
- case 16:
- case 20:
- return 1;
- default:
- return 0;
+ case 1:
+ case 2:
+ case 16:
+ case 20:
+ return 1;
+ default:
+ return 0;
}
}
{
switch (type)
{
- case 1:
- case 3:
- case 17:
- case 20:
- return 1;
- default:
- return 0;
+ case 1:
+ case 3:
+ case 17:
+ case 20:
+ return 1;
+ default:
+ return 0;
}
}
dprint (1, (debugfile, "pgp_find_hash: No packet.\n"));
}
- bye:
+bye:
safe_fclose (&in);
safe_fclose (&out);
}
case 1:
- bytes = 2;
+ bytes = 2;
case 2:
{
}
default:
- goto bail;
+ goto bail;
}
if (read_material (material, &used, fp) == -1)
switch (buff[1])
{
- case 2:
- case 3:
- return pgp_parse_pgp2_key (buff, l);
- case 4:
- return pgp_parse_pgp3_key (buff, l);
- default:
- return NULL;
+ case 2:
+ case 3:
+ return pgp_parse_pgp2_key (buff, l);
+ case 4:
+ return pgp_parse_pgp3_key (buff, l);
+ default:
+ return NULL;
}
}
break;
}
case 10: /* CMR key */
- break;
+ break;
case 4: /* exportable */
case 5: /* trust */
case 6: /* regexp */
switch (buff[1])
{
- case 2:
- case 3:
- return pgp_parse_pgp2_sig (buff, l, p, sig);
- case 4:
- return pgp_parse_pgp3_sig (buff, l, p, sig);
- default:
- return -1;
+ case 2:
+ case 3:
+ return pgp_parse_pgp2_sig (buff, l, p, sig);
+ case 4:
+ return pgp_parse_pgp3_sig (buff, l, p, sig);
+ default:
+ return -1;
}
}
dprint (1, (debugfile, "pop_read_header: unset TOP capability\n"));
snprintf (pop_data->err_msg, sizeof (pop_data->err_msg), "%s",
- _("Command TOP is not supported by server."));
+ _("Command TOP is not supported by server."));
}
}
}
errno = 0;
index = strtol(line, &endp, 10);
if (errno)
- return -1;
+ return -1;
while (*endp == ' ')
- endp++;
+ endp++;
memmove(line, endp, strlen(endp) + 1);
/* uid must be at least be 1 byte */
dprint (1, (debugfile, "pop_fetch_headers: unset UIDL capability\n"));
snprintf (pop_data->err_msg, sizeof (pop_data->err_msg), "%s",
- _("Command UIDL is not supported by server."));
+ _("Command UIDL is not supported by server."));
}
}
}
else
#endif
- if ((ret = pop_read_header (pop_data, ctx->hdrs[i])) < 0)
- break;
+ if ((ret = pop_read_header (pop_data, ctx->hdrs[i])) < 0)
+ break;
#if USE_HCACHE
- else
- {
- mutt_hcache_store (hc, ctx->hdrs[i]->data, ctx->hdrs[i], 0, strlen, MUTT_GENERATE_UIDVALIDITY);
- }
+ else
+ {
+ mutt_hcache_store (hc, ctx->hdrs[i]->data, ctx->hdrs[i], 0, strlen, MUTT_GENERATE_UIDVALIDITY);
+ }
mutt_hcache_free (&data);
#endif
}
#if USE_HCACHE
- mutt_hcache_close (hc);
+ mutt_hcache_close (hc);
#endif
if (ret < 0)
dprint (1, (debugfile, "pop_auth_user: unset USER capability\n"));
snprintf (pop_data->err_msg, sizeof (pop_data->err_msg), "%s",
- _("Command USER is not supported by server."));
+ _("Command USER is not supported by server."));
}
}
snprintf (buf, sizeof (buf), "PASS %s\r\n", pop_data->conn->account.pass);
ret = pop_query_d (pop_data, buf, sizeof (buf),
#ifdef DEBUG
- /* don't print the password unless we're at the ungodly debugging level */
- debuglevel < MUTT_SOCK_LOG_FULL ? "PASS *\r\n" :
+ /* don't print the password unless we're at the ungodly debugging level */
+ debuglevel < MUTT_SOCK_LOG_FULL ? "PASS *\r\n" :
#endif
- NULL);
+ NULL);
}
switch (ret)
ret = pop_query_d (pop_data, auth_cmd, strlen (auth_cmd),
#ifdef DEBUG
- /* don't print the bearer token unless we're at the ungodly debugging level */
- debuglevel < MUTT_SOCK_LOG_FULL ? "AUTH OAUTHBEARER *\r\n" :
+ /* don't print the bearer token unless we're at the ungodly debugging level */
+ debuglevel < MUTT_SOCK_LOG_FULL ? "AUTH OAUTHBEARER *\r\n" :
#endif
- NULL);
+ NULL);
FREE (&auth_cmd);
switch (ret)
* -1 - connection lost,
* -2 - login failed,
* -3 - authentication canceled.
-*/
+ */
int pop_authenticate (POP_DATA* pop_data)
{
ACCOUNT *acct = &pop_data->conn->account;
else
{
safe_realloc (&pop_data->auth_list,
- strlen (pop_data->auth_list) + strlen (line) + 2);
+ strlen (pop_data->auth_list) + strlen (line) + 2);
strcat (pop_data->auth_list, " "); /* __STRCAT_CHECKED__ */
}
strcat (pop_data->auth_list, line); /* __STRCAT_CHECKED__ */
* 0 - successful,
* -1 - connection lost,
* -2 - execution error.
-*/
+ */
static int pop_capabilities (POP_DATA *pop_data, int mode)
{
char buf[LONG_STRING];
* 0 - successful,
* -1 - connection lost,
* -2 - invalid response.
-*/
+ */
int pop_connect (POP_DATA *pop_data)
{
char buf[LONG_STRING];
* -1 - connection lost,
* -2 - invalid command or execution error,
* -3 - authentication canceled.
-*/
+ */
int pop_open_connection (POP_DATA *pop_data)
{
int ret;
if (pop_data->use_stls == 0)
{
ret = query_quadoption (OPT_SSLSTARTTLS,
- _("Secure connection with TLS?"));
+ _("Secure connection with TLS?"));
if (ret == -1)
return -2;
pop_data->use_stls = 1;
* 0 - successful,
* -1 - connection lost,
* -2 - invalid command or execution error.
-*/
+ */
int pop_query_d (POP_DATA *pop_data, char *buf, size_t buflen, char *msg)
{
int dbg = MUTT_SOCK_LOG_CMD;
return -1;
#ifdef DEBUG
- /* print msg instead of real command */
- if (msg)
- {
- dbg = MUTT_SOCK_LOG_FULL;
- dprint (MUTT_SOCK_LOG_CMD, (debugfile, "> %s", msg));
- }
+ /* print msg instead of real command */
+ if (msg)
+ {
+ dbg = MUTT_SOCK_LOG_FULL;
+ dprint (MUTT_SOCK_LOG_CMD, (debugfile, "> %s", msg));
+ }
#endif
mutt_socket_write_d (pop_data->conn, buf, -1, dbg);
errno = 0;
index = strtoul(line, &endp, 10);
if (errno)
- return -1;
+ return -1;
while (*endp == ' ')
- endp++;
+ endp++;
memmove(line, endp, strlen(endp) + 1);
for (i = 0; i < ctx->msgcount; i++)
return -1;
if (query_quadoption (OPT_POPRECONNECT,
- _("Connection lost. Reconnect to POP server?")) != MUTT_YES)
+ _("Connection lost. Reconnect to POP server?")) != MUTT_YES)
return -1;
}
}
if (stat (Postponed, &st) == -1)
{
- PostCount = 0;
- LastModify = 0;
- return (0);
+ PostCount = 0;
+ LastModify = 0;
+ return (0);
}
if (S_ISDIR (st.st_mode))
tmp->next = NULL;
mutt_free_list (&tmp);
tmp = next;
- /* 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
- */
+ /* 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
+ */
code |= SENDPOSTPONEDFCC;
}
else if ((WithCrypto & APPLICATION_PGP)
&& (mutt_strncmp ("Pgp:", tmp->data, 4) == 0 /* this is generated
- * by old mutt versions
- */
+ * by old mutt versions
+ */
|| mutt_strncmp ("X-Mutt-PGP:", tmp->data, 11) == 0))
{
hdr->security = mutt_parse_crypt_hdr (strchr (tmp->data, ':') + 1, 1,
*q = '\0';
break;
- /* 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.
- */
+ /* 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.
+ */
case 'm':
case 'M':
if(*(p+1) == '<')
rv = 0;
- bail:
+bail:
/* that's it. */
if (bfp != fp) safe_fclose (&bfp);
#define mutt_make_string(A,B,C,D,E) _mutt_make_string(A,B,C,D,E,0)
void _mutt_make_string (char *, size_t, const char *, CONTEXT *,
- HEADER *, format_flag);
+ HEADER *, format_flag);
struct hdr_format_info
{
const char *mutt_attach_fmt (
- char *dest,
- size_t destlen,
- size_t col,
- int cols,
- char op,
- const char *src,
- const char *prefix,
- const char *ifstring,
- const char *elsestring,
- unsigned long data,
- format_flag flags);
+ char *dest,
+ size_t destlen,
+ size_t col,
+ int cols,
+ char op,
+ const char *src,
+ const char *prefix,
+ const char *ifstring,
+ const char *elsestring,
+ unsigned long data,
+ format_flag flags);
char *mutt_charset_hook (const char *);
int mutt_parse_push (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_parse_rc_line (/* const */ char *, BUFFER *, BUFFER *);
int mutt_parse_rfc822_line (ENVELOPE *e, HEADER *hdr, char *line, char *p,
- short user_hdrs, short weed, short do_2047, LIST **lastp);
+ short user_hdrs, short weed, short do_2047, LIST **lastp);
int mutt_parse_score (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_parse_unscore (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_parse_unhook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
int mutt_wctoutf8 (char *s, unsigned int c, size_t buflen);
#ifdef LOCALES_HACK
-#define IsPrint(c) (isprint((unsigned char)(c)) || \
- ((unsigned char)(c) >= 0xa0))
+#define IsPrint(c) (isprint((unsigned char)(c)) || \
+ ((unsigned char)(c) >= 0xa0))
#define IsWPrint(wc) (iswprint(wc) || wc >= 0xa0)
#else
-#define IsPrint(c) (isprint((unsigned char)(c)) || \
- (option (OPTLOCALES) ? 0 : \
- ((unsigned char)(c) >= 0xa0)))
-#define IsWPrint(wc) (iswprint(wc) || \
- (option (OPTLOCALES) ? 0 : (wc >= 0xa0)))
+#define IsPrint(c) (isprint((unsigned char)(c)) || \
+ (option (OPTLOCALES) ? 0 : \
+ ((unsigned char)(c) >= 0xa0)))
+#define IsWPrint(wc) (iswprint(wc) || \
+ (option (OPTLOCALES) ? 0 : (wc >= 0xa0)))
#endif
#define new_pattern() safe_calloc(1, sizeof (pattern_t))
switch (op)
{
- case 'a':
- rfc822_write_address (buf2, sizeof (buf2), query->addr, 1);
- mutt_format_s (dest, destlen, fmt, buf2);
- break;
- case 'c':
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, query->num + 1);
- break;
- case 'e':
- if (!optional)
- mutt_format_s (dest, destlen, fmt, NONULL (query->other));
- else if (!query->other || !*query->other)
- optional = 0;
- break;
- case 'n':
- mutt_format_s (dest, destlen, fmt, NONULL (query->name));
- break;
- case 't':
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- snprintf (dest, destlen, tmp, entry->tagged ? '*' : ' ');
- break;
- default:
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- snprintf (dest, destlen, tmp, op);
- break;
+ case 'a':
+ rfc822_write_address (buf2, sizeof (buf2), query->addr, 1);
+ mutt_format_s (dest, destlen, fmt, buf2);
+ break;
+ case 'c':
+ snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
+ snprintf (dest, destlen, tmp, query->num + 1);
+ break;
+ case 'e':
+ if (!optional)
+ mutt_format_s (dest, destlen, fmt, NONULL (query->other));
+ else if (!query->other || !*query->other)
+ optional = 0;
+ break;
+ case 'n':
+ mutt_format_s (dest, destlen, fmt, NONULL (query->name));
+ break;
+ case 't':
+ snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
+ snprintf (dest, destlen, tmp, entry->tagged ? '*' : ' ');
+ break;
+ default:
+ snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
+ snprintf (dest, destlen, tmp, op);
+ break;
}
if (optional)
static const char *Mailbox_is_read_only = N_("Mailbox is read-only.");
-#define CHECK_READONLY if (Context->readonly) \
-{\
- mutt_flushinp (); \
- mutt_error _(Mailbox_is_read_only); \
- break; \
-}
+#define CHECK_READONLY \
+ if (Context->readonly) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(Mailbox_is_read_only); \
+ break; \
+ }
#define CURATTACH actx->idx[actx->v2r[menu->current]]
* %u = unlink
*/
const char *mutt_attach_fmt (char *dest,
- size_t destlen,
- size_t col,
- int cols,
- char op,
- const char *src,
- const char *prefix,
- const char *ifstring,
- const char *elsestring,
- unsigned long data,
- format_flag flags)
+ size_t destlen,
+ size_t col,
+ int cols,
+ char op,
+ const char *src,
+ const char *prefix,
+ const char *ifstring,
+ const char *elsestring,
+ unsigned long data,
+ format_flag flags)
{
char fmt[16];
char tmp[SHORT_STRING];
}
else if(aptr->content->description ||
(mutt_is_message_type (aptr->content->type, aptr->content->subtype)
- && MsgFmt && aptr->content->hdr))
+ && MsgFmt && aptr->content->hdr))
break;
- /* FALLS THROUGH TO 'F' */
+ /* FALLS THROUGH TO 'F' */
case 'F':
if (!optional)
{
optional = 0;
break;
}
- /* FALLS THROUGH TO 'f' */
+ /* FALLS THROUGH TO 'f' */
case 'f':
if(!optional)
{
case 'e':
if(!optional)
mutt_format_s (dest, destlen, prefix,
- ENCODING (aptr->content->encoding));
+ ENCODING (aptr->content->encoding));
break;
case 'I':
if (!optional)
case 'Q':
if (optional)
optional = aptr->content->attach_qualifies;
- else {
- snprintf (fmt, sizeof (fmt), "%%%sc", prefix);
+ else
+ {
+ snprintf (fmt, sizeof (fmt), "%%%sc", prefix);
mutt_format_s (dest, destlen, fmt, "Q");
}
break;
prepend_curdir (buf, sizeof (buf));
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf),
- MUTT_FILE | MUTT_CLEAR) != 0 || !buf[0])
+ MUTT_FILE | MUTT_CLEAR) != 0 || !buf[0])
return;
mutt_expand_path (buf, sizeof (buf));
if (mutt_check_overwrite (top->filename, buf, tfile,
state.flags = MUTT_CHARCONV;
if (mutt_get_field ((filter ? _("Filter through: ") : _("Pipe to: ")),
- buf, sizeof (buf), MUTT_CMD) != 0 || !buf[0])
+ buf, sizeof (buf), MUTT_CMD) != 0 || !buf[0])
return;
mutt_expand_path (buf, sizeof (buf));
new_fp = NULL;
secured = !crypt_smime_decrypt_mime (outer_fp, &new_fp, outer_new_body,
- &new_body);
+ &new_body);
mutt_free_body (&outer_new_body);
safe_fclose (&outer_fp);
static const char *Function_not_permitted = N_("Function not permitted in attach-message mode.");
-#define CHECK_ATTACH if(option(OPTATTACHMSG)) \
- {\
- mutt_flushinp (); \
- mutt_error _(Function_not_permitted); \
- break; \
- }
+#define CHECK_ATTACH \
+ if (option(OPTATTACHMSG)) \
+ { \
+ mutt_flushinp (); \
+ mutt_error _(Function_not_permitted); \
+ break; \
+ }
break;
case OP_UNDELETE:
- CHECK_READONLY;
- if (!menu->tagprefix)
- {
- CURATTACH->content->deleted = 0;
- if (option (OPTRESOLVE) && menu->current < menu->max - 1)
- {
- menu->current++;
- menu->redraw = REDRAW_MOTION_RESYNCH;
- }
- else
- menu->redraw = REDRAW_CURRENT;
- }
- else
- {
- int x;
-
- for (x = 0; x < menu->max; x++)
- {
- if (actx->idx[x]->content->tagged)
- {
- actx->idx[x]->content->deleted = 0;
- menu->redraw = REDRAW_INDEX;
- }
- }
- }
- break;
+ CHECK_READONLY;
+ if (!menu->tagprefix)
+ {
+ CURATTACH->content->deleted = 0;
+ if (option (OPTRESOLVE) && menu->current < menu->max - 1)
+ {
+ menu->current++;
+ menu->redraw = REDRAW_MOTION_RESYNCH;
+ }
+ else
+ menu->redraw = REDRAW_CURRENT;
+ }
+ else
+ {
+ int x;
+
+ for (x = 0; x < menu->max; x++)
+ {
+ if (actx->idx[x]->content->tagged)
+ {
+ actx->idx[x]->content->deleted = 0;
+ menu->redraw = REDRAW_INDEX;
+ }
+ }
+ }
+ break;
case OP_RESEND:
CHECK_ATTACH;
**/
void mutt_attach_bounce (FILE * fp, HEADER * hdr,
- ATTACH_CONTEXT *actx, BODY * cur)
+ ATTACH_CONTEXT *actx, BODY * cur)
{
short i;
char prompt[STRING];
* See commands.c.
*/
snprintf (prompt, sizeof (prompt) - 4,
- (p ? _("Bounce message to %s") : _("Bounce messages to %s")), buf);
+ (p ? _("Bounce message to %s") : _("Bounce messages to %s")), buf);
if (mutt_strwidth (prompt) > MuttMessageWindow->cols - extra_space)
{
&& !check_can_decode (actx, cur))
{
if ((rc = query_quadoption (OPT_MIMEFWDREST,
-_("Can't decode all tagged attachments. MIME-forward the others?"))) == -1)
+ _("Can't decode all tagged attachments. MIME-forward the others?"))) == -1)
goto bail;
else if (rc == MUTT_NO)
mime_fwd_any = 0;
ci_send_message (0, tmphdr, tmpbody, NULL, parent_hdr);
return;
- bail:
+bail:
if (tmpfp)
{
*/
static void attach_forward_msgs (FILE * fp, HEADER * hdr,
- ATTACH_CONTEXT *actx, BODY * cur)
+ ATTACH_CONTEXT *actx, BODY * cur)
{
HEADER *curhdr = NULL;
HEADER *tmphdr;
tmpbody[0] = '\0';
if ((rc = query_quadoption (OPT_MIMEFWD,
- _("Forward MIME encapsulated?"))) == MUTT_NO)
+ _("Forward MIME encapsulated?"))) == MUTT_NO)
{
/* no MIME encapsulation */
{
/* L10N: You will see this error message if you invoke <compose-to-sender>
when you are on a normal attachment.
- */
+ */
mutt_error _("You may only compose to sender with message/rfc822 parts.");
return;
}
if (nattach > 1 && !check_can_decode (actx, cur))
{
if ((rc = query_quadoption (OPT_MIMEFWDREST,
- _("Can't decode all tagged attachments. MIME-encapsulate the others?"))) == -1)
+ _("Can't decode all tagged attachments. MIME-encapsulate the others?"))) == -1)
return;
else if (rc == MUTT_YES)
mime_reply_any = 1;
safe_fclose (&tmpfp);
if (ci_send_message (flags, tmphdr, tmpbody, NULL,
- parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL)) == 0)
+ parent_hdr ? parent_hdr : (cur ? cur->hdr : NULL)) == 0)
mutt_set_flag (Context, hdr, MUTT_REPLIED, 1);
}
mix_add_entry (&type2_list, p, &slots, &used);
continue;
- problem:
+ problem:
mix_free_remailer (&p);
}
(type2_list[chain->ch[chain->cl-1]]->caps & MIX_CAP_MIDDLEMAN))
{
mutt_error ( _("Error: %s can't be used as the final remailer of a chain."),
- type2_list[chain->ch[chain->cl - 1]]->shortname);
+ type2_list[chain->ch[chain->cl - 1]]->shortname);
}
else
{
}
else
mutt_error ( _("Mixmaster chains are limited to %d elements."),
- MAXMIXES);
+ MAXMIXES);
break;
}
* and 1 if the command works on a pipe.
*/
int rfc1524_expand_command (BODY *a, const char *filename, const char *_type,
- char *command, int clen)
+ char *command, int clen)
{
int x=0,y=0;
int needspipe = TRUE;
}
}
mutt_convert_string (ps,
- (const char *)mutt_get_default_charset (),
- Charset, MUTT_ICONV_HOOK_FROM);
+ (const char *)mutt_get_default_charset (),
+ Charset, MUTT_ICONV_HOOK_FROM);
return -1;
}
char *mutt_choose_charset (const char *fromcode, const char *charsets,
- char *u, size_t ulen, char **d, size_t *dlen)
+ char *u, size_t ulen, char **d, size_t *dlen)
{
char canonical_buff[LONG_STRING];
char *e = 0, *tocode = 0;
while (pp1 && *(pp1 + 1) != '=')
pp1 = strchr(pp1 + 1, '?');
if (!pp1)
- goto error_out_0;
+ goto error_out_0;
}
switch (count)
*/
char *mutt_choose_charset (const char *fromcode, const char *charsets,
- char *u, size_t ulen, char **d, size_t *dlen);
+ char *u, size_t ulen, char **d, size_t *dlen);
int convert_nonmime_string (char **);
void _rfc2047_encode_string (char **, int, int);
char *value;
int index;
int encoded;
- struct rfc2231_parameter
- *next;
+ struct rfc2231_parameter *next;
};
static char *rfc2231_get_charset (char *, char *, size_t);
if (!Charset || !SendCharset ||
!(charset = mutt_choose_charset (Charset, SendCharset,
- *pd, strlen (*pd), &d, &dlen)))
+ *pd, strlen (*pd), &d, &dlen)))
{
charset = safe_strdup (Charset ? Charset : "unknown-8bit");
d = *pd;
#include "mutt_idna.h"
-#define terminate_string(a, b, c) do { if ((b) < (c)) a[(b)] = 0; else \
- a[(c)] = 0; } while (0)
+#define terminate_string(a, b, c) \
+ do \
+ { \
+ if ((b) < (c)) \
+ a[(b)] = 0; \
+ else \
+ a[(c)] = 0; \
+ } while (0)
#define terminate_buffer(a, b) terminate_string(a, b, sizeof (a) - 1)
if ((mutt_addrcmp (env->from, env->reply_to) && !env->reply_to->next &&
!env->reply_to->personal) ||
(option (OPTIGNORELISTREPLYTO) &&
- mutt_is_mail_list (env->reply_to) &&
- (mutt_addrsrc (env->reply_to, env->to) ||
- mutt_addrsrc (env->reply_to, env->cc))))
+ mutt_is_mail_list (env->reply_to) &&
+ (mutt_addrsrc (env->reply_to, env->to) ||
+ mutt_addrsrc (env->reply_to, env->cc))))
{
/* If the Reply-To: address is a mailing list, assume that it was
* put there by the mailing list, and use the From: address
env->reply_to->next?",...":"");
switch (query_quadoption (OPT_REPLYTO, prompt))
{
- case MUTT_YES:
- rfc822_append (to, env->reply_to, 0);
- break;
+ case MUTT_YES:
+ rfc822_append (to, env->reply_to, 0);
+ break;
- case MUTT_NO:
- rfc822_append (to, env->from, 0);
- break;
+ case MUTT_NO:
+ rfc822_append (to, env->from, 0);
+ break;
- default:
- return (-1); /* abort */
+ default:
+ return (-1); /* abort */
}
}
else
}
void mutt_make_misc_reply_headers (ENVELOPE *env, CONTEXT *ctx,
- HEADER *cur, ENVELOPE *curenv)
+ HEADER *cur, ENVELOPE *curenv)
{
/* This takes precedence over a subject that might have
* been taken from a List-Post header. Is that correct?
#if USE_SMTP
if (SmtpUrl)
- return mutt_smtp_send (msg->env->from, msg->env->to, msg->env->cc,
- msg->env->bcc, tempfile,
- (msg->content->encoding == ENC8BIT));
+ return mutt_smtp_send (msg->env->from, msg->env->to, msg->env->cc,
+ msg->env->bcc, tempfile,
+ (msg->content->encoding == ENC8BIT));
#endif /* USE_SMTP */
i = mutt_invoke_sendmail (msg->env->from, msg->env->to, msg->env->cc,
static int is_reply (HEADER *reply, HEADER *orig)
{
return mutt_find_list (orig->env->references, reply->env->message_id) ||
- mutt_find_list (orig->env->in_reply_to, reply->env->message_id);
+ mutt_find_list (orig->env->in_reply_to, reply->env->message_id);
}
static int has_recips (ADDRESS *a)
process_user_header (msg->env);
if (flags & SENDBATCH)
- mutt_copy_stream (stdin, tempfp);
+ mutt_copy_stream (stdin, tempfp);
if (option (OPTSIGONTOP) && ! (flags & (SENDMAILX|SENDKEY|SENDBATCH))
&& Editor && mutt_strcmp (Editor, "builtin") != 0)
&& (cur->security & APPLICATION_PGP))
msg->security |= APPLICATION_PGP;
else if ((WithCrypto & APPLICATION_SMIME) && option (OPTCRYPTAUTOSMIME)
- && (cur->security & APPLICATION_SMIME))
+ && (cur->security & APPLICATION_SMIME))
msg->security |= APPLICATION_SMIME;
}
return (ferror (f) ? -1 : 0);
}
-# define write_as_text_part(a) (mutt_is_text_part(a) \
- || ((WithCrypto & APPLICATION_PGP)\
- && mutt_is_application_pgp(a)))
+#define write_as_text_part(a) \
+ (mutt_is_text_part(a) || \
+ ((WithCrypto & APPLICATION_PGP) && mutt_is_application_pgp(a)))
int mutt_write_mime_body (BODY *a, FILE *f)
{
}
}
- bye:
+bye:
if (type != TYPEOTHER || *xtype != '\0')
{
fputc ('\n', fpout);
mutt_write_mime_body (a->parts, fpout);
- cleanup:
+cleanup:
FREE (&line);
if (fpin && fpin != fp)
{
/* Determine which encoding is smaller */
if (1.33 * (float)(info->lobin+info->hibin+info->ascii) <
- 3.0 * (float)(info->lobin + info->hibin) + (float)info->ascii)
+ 3.0 * (float)(info->lobin + info->hibin) + (float)info->ascii)
b->encoding = ENCBASE64;
else
b->encoding = ENCQUOTEDPRINTABLE;
}
static int fold_one_header (FILE *fp, const char *tag, const char *value,
- const char *pfx, int wraplen, int flags)
+ const char *pfx, int wraplen, int flags)
{
const char *p = value, *next, *sp;
char buf[HUGE_STRING] = "";
else
{
st = (SendmailWait > 0 && errno == EINTR && SigAlrm) ?
- S_BKG : S_ERR;
+ S_BKG : S_ERR;
if (SendmailWait > 0 && tempfile && *tempfile)
{
unlink (*tempfile);
int
mutt_invoke_sendmail (ADDRESS *from, /* the sender */
- ADDRESS *to, ADDRESS *cc, ADDRESS *bcc, /* recips */
- const char *msg, /* file containing message */
- int eightbit) /* message contains 8bit chars */
+ ADDRESS *to, ADDRESS *cc, ADDRESS *bcc, /* recips */
+ const char *msg, /* file containing message */
+ int eightbit) /* message contains 8bit chars */
{
char *ps = NULL, *path = NULL, *s = safe_strdup (Sendmail), *childout = NULL;
char **args = NULL;
}
static int _mutt_bounce_message (FILE *fp, HEADER *h, ADDRESS *to, const char *resent_from,
- ADDRESS *env_from)
+ ADDRESS *env_from)
{
int i, ret = 0;
FILE *f;
if (!h)
{
- /* Try to bounce each message out, aborting if we get any failures. */
+ /* Try to bounce each message out, aborting if we get any failures. */
for (i=0; i<Context->msgcount; i++)
if (Context->hdrs[i]->tagged)
ret |= _mutt_bounce_message (fp, Context->hdrs[i], to, resent_from, env_from);
h->content->encoding == ENC8BIT);
else
#endif /* USE_SMTP */
- ret = mutt_invoke_sendmail (env_from, to, NULL, NULL, tempfile,
- h->content->encoding == ENC8BIT);
+ ret = mutt_invoke_sendmail (env_from, to, NULL, NULL, tempfile,
+ h->content->encoding == ENC8BIT);
}
if (msg)
&& post && (hdr->security & APPLICATION_SMIME))
{
fputs ("X-Mutt-SMIME: ", msg->fp);
- if (hdr->security & ENCRYPT) {
- fputc ('E', msg->fp);
- if (SmimeCryptAlg && *SmimeCryptAlg)
- fprintf (msg->fp, "C<%s>", SmimeCryptAlg);
+ if (hdr->security & ENCRYPT)
+ {
+ fputc ('E', msg->fp);
+ if (SmimeCryptAlg && *SmimeCryptAlg)
+ fprintf (msg->fp, "C<%s>", SmimeCryptAlg);
}
if (hdr->security & OPPENCRYPT)
fputc ('O', msg->fp);
- if (hdr->security & SIGN) {
- fputc ('S', msg->fp);
- if (SmimeSignAs && *SmimeSignAs)
- fprintf (msg->fp, "<%s>", SmimeSignAs);
+ if (hdr->security & SIGN)
+ {
+ fputc ('S', msg->fp);
+ if (SmimeSignAs && *SmimeSignAs)
+ fprintf (msg->fp, "<%s>", SmimeSignAs);
}
if (hdr->security & INLINE)
fputc ('I', msg->fp);
int
setenv(const char *name, const char *value, int overwrite)
{
- char *envstring;
+ char *envstring;
- if (!overwrite && getenv(name) != NULL)
- return 0;
+ if (!overwrite && getenv(name) != NULL)
+ return 0;
- /* Allocate memory for the environment string. We intentionally don't
- use concat here, or the xmalloc family of allocation routines, since
- the intention is to provide a replacement for the standard library
- function which sets errno and returns in the event of a memory
- allocation failure. */
- envstring = malloc(strlen(name) + 1 + strlen(value) + 1); /* __MEM_CHECKED__ */
- if (envstring == NULL)
- return -1;
+ /* Allocate memory for the environment string. We intentionally don't
+ use concat here, or the xmalloc family of allocation routines, since
+ the intention is to provide a replacement for the standard library
+ function which sets errno and returns in the event of a memory
+ allocation failure. */
+ envstring = malloc(strlen(name) + 1 + strlen(value) + 1); /* __MEM_CHECKED__ */
+ if (envstring == NULL)
+ return -1;
- /* Build the environment string and add it to the environment using
- putenv. Systems without putenv lose, but XPG4 requires it. */
- strcpy(envstring, name); /* __STRCPY_CHECKED__ */
- strcat(envstring, "="); /* __STRCAT_CHECKED__ */
- strcat(envstring, value); /* __STRCAT_CHECKED__ */
- return putenv(envstring);
+ /* Build the environment string and add it to the environment using
+ putenv. Systems without putenv lose, but XPG4 requires it. */
+ strcpy(envstring, name); /* __STRCPY_CHECKED__ */
+ strcat(envstring, "="); /* __STRCAT_CHECKED__ */
+ strcat(envstring, value); /* __STRCAT_CHECKED__ */
+ return putenv(envstring);
- /* Note that the memory allocated is not freed. This is intentional;
- many implementations of putenv assume that the string passed to
- putenv will never be freed and don't make a copy of it. Repeated use
- of this function will therefore leak memory, since most
- implementations of putenv also don't free strings removed from the
- environment (due to being overwritten). */
+ /* Note that the memory allocated is not freed. This is intentional;
+ many implementations of putenv assume that the string passed to
+ putenv will never be freed and don't make a copy of it. Repeated use
+ of this function will therefore leak memory, since most
+ implementations of putenv also don't free strings removed from the
+ environment (due to being overwritten). */
}
else if (b->msg_flagged > 0)
SETCOLOR(MT_COLOR_FLAGGED);
else if ((ColorDefs[MT_COLOR_SB_SPOOLFILE] != 0) &&
- (mutt_strcmp (b->path, Spoolfile) == 0))
+ (mutt_strcmp (b->path, Spoolfile) == 0))
SETCOLOR(MT_COLOR_SB_SPOOLFILE);
else
SETCOLOR(MT_COLOR_NORMAL);
if (option (OPTSIDEBARSHORTPATH))
tmp_folder_name += lastsep; /* basename */
int sfn_len = mutt_strlen (tmp_folder_name) +
- sidebar_folder_depth*mutt_strlen (SidebarIndentString) + 1;
+ sidebar_folder_depth*mutt_strlen (SidebarIndentString) + 1;
sidebar_folder_name = safe_malloc (sfn_len);
sidebar_folder_name[0]=0;
for (i=0; i < sidebar_folder_depth; i++)
smime_void_passphrase();
if (mutt_get_password (_("Enter S/MIME passphrase:"), SmimePass, sizeof (SmimePass)) == 0)
- {
- SmimeExptime = mutt_add_timeout (time (NULL), SmimeTimeout);
- return (1);
- }
+ {
+ SmimeExptime = mutt_add_timeout (time (NULL), SmimeTimeout);
+ return (1);
+ }
else
SmimeExptime = 0;
struct smime_command_context *cctx, const char *fmt)
{
mutt_FormatString (d, dlen, 0, MuttIndexWindow->cols, NONULL(fmt), _mutt_fmt_smime_command,
- (unsigned long) cctx, 0);
+ (unsigned long) cctx, 0);
dprint (2,(debugfile, "mutt_smime_command: %s\n", d));
}
}
snprintf(title, sizeof(title), _("S/MIME certificates matching \"%s\"."),
- query);
+ query);
/* Make Helpstring */
helpstr[0] = 0;
mutt_make_help (buf, sizeof (buf), _("Exit "), MENU_SMIME, OP_EXIT);
strcat (helpstr, buf); /* __STRCAT_CHECKED__ */
mutt_make_help (buf, sizeof (buf), _("Select "), MENU_SMIME,
- OP_GENERIC_SELECT_ENTRY);
+ OP_GENERIC_SELECT_ENTRY);
strcat (helpstr, buf); /* __STRCAT_CHECKED__ */
mutt_make_help (buf, sizeof(buf), _("Help"), MENU_SMIME, OP_HELP);
strcat (helpstr, buf); /* __STRCAT_CHECKED__ */
results_end = &results;
snprintf(index_file, sizeof (index_file), "%s/.index",
- public ? NONULL(SmimeCertificates) : NONULL(SmimeKeys));
+ public ? NONULL(SmimeCertificates) : NONULL(SmimeKeys));
if ((fp = safe_fopen (index_file, "r")) == NULL)
{
/*
- This sets the '*ToUse' variables for an upcoming decryption, where
- the required key is different from SmimeDefaultKey.
+ This sets the '*ToUse' variables for an upcoming decryption, where
+ the required key is different from SmimeDefaultKey.
*/
void _smime_getkeys (char *mailbox)
static int smime_handle_cert_email (char *certificate, char *mailbox,
- int copy, char ***buffer, int *num)
+ int copy, char ***buffer, int *num)
{
FILE *fpout = NULL, *fperr = NULL;
char tmpfname[_POSIX_PATH_MAX];
if (smime_handle_cert_email (certfile, mbox, 0, NULL, NULL))
{
if(isendwin())
- mutt_any_key_to_continue(NULL);
+ mutt_any_key_to_continue(NULL);
}
else
retval = 0;
mutt_unlink(certfile);
FREE (&certfile);
}
- else
- mutt_any_key_to_continue(_("no certfile"));
+ else
+ mutt_any_key_to_continue(_("no certfile"));
}
else
- mutt_any_key_to_continue(_("no mbox"));
+ mutt_any_key_to_continue(_("no mbox"));
mutt_unlink(tempfname);
return retval;
snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s",
- NONULL(SmimeKeys), signas);
+ NONULL(SmimeKeys), signas);
snprintf (SmimeCertToUse, sizeof (SmimeCertToUse), "%s/%s",
- NONULL(SmimeCertificates), signas);
+ NONULL(SmimeCertificates), signas);
signas_key = smime_get_key_by_hash (signas, 1);
if ((! signas_key) ||
intermediates = signas_key->issuer;
snprintf (SmimeIntermediateToUse, sizeof (SmimeIntermediateToUse), "%s/%s",
- NONULL(SmimeCertificates), intermediates);
+ NONULL(SmimeCertificates), intermediates);
smime_free_key (&signas_key);
if ((thepid = smime_invoke_sign (&smimein, NULL, &smimeerr,
- -1, fileno (smimeout), -1, filetosign)) == -1)
+ -1, fileno (smimeout), -1, filetosign)) == -1)
{
mutt_perror _("Can't open OpenSSL subprocess!");
safe_fclose (&smimeout);
FREE (&micalg);
mutt_set_parameter ("protocol", "application/x-pkcs7-signature",
- &t->parameter);
+ &t->parameter);
t->parts = a;
a = t;
crypt_current_time (s, "OpenSSL");
if ((thepid = smime_invoke_verify (NULL, &smimeout, NULL,
- -1, -1, fileno (smimeerr),
- tempfile, signedfile, 0)) != -1)
+ -1, -1, fileno (smimeerr),
+ tempfile, signedfile, 0)) != -1)
{
fflush (smimeout);
safe_fclose (&smimeout);
{
switch (choices[choice - 1])
{
- case 'e': /* (e)ncrypt */
- msg->security |= ENCRYPT;
- msg->security &= ~SIGN;
- break;
+ case 'e': /* (e)ncrypt */
+ msg->security |= ENCRYPT;
+ msg->security &= ~SIGN;
+ break;
- case 'w': /* encrypt (w)ith */
+ case 'w': /* encrypt (w)ith */
{
msg->security |= ENCRYPT;
do
{
/* I use "dra" because "123" is recognized anyway */
switch (mutt_multi_choice (_("Choose algorithm family:"
- " 1: DES, 2: RC2, 3: AES,"
- " or (c)lear? "),
- _("drac")))
+ " 1: DES, 2: RC2, 3: AES,"
+ " or (c)lear? "),
+ _("drac")))
{
- case 1:
- switch (choice = mutt_multi_choice (_("1: DES, 2: Triple-DES "),
- _("dt")))
- {
case 1:
- mutt_str_replace (&SmimeCryptAlg, "des");
+ switch (choice = mutt_multi_choice (_("1: DES, 2: Triple-DES "),
+ _("dt")))
+ {
+ case 1:
+ mutt_str_replace (&SmimeCryptAlg, "des");
+ break;
+ case 2:
+ mutt_str_replace (&SmimeCryptAlg, "des3");
+ break;
+ }
break;
- case 2:
- mutt_str_replace (&SmimeCryptAlg, "des3");
- break;
- }
- break;
- case 2:
- switch (choice = mutt_multi_choice (_("1: RC2-40, 2: RC2-64, 3: RC2-128 "),
- _("468")))
- {
- case 1:
- mutt_str_replace (&SmimeCryptAlg, "rc2-40");
- break;
case 2:
- mutt_str_replace (&SmimeCryptAlg, "rc2-64");
- break;
- case 3:
- mutt_str_replace (&SmimeCryptAlg, "rc2-128");
+ switch (choice = mutt_multi_choice (_("1: RC2-40, 2: RC2-64, 3: RC2-128 "),
+ _("468")))
+ {
+ case 1:
+ mutt_str_replace (&SmimeCryptAlg, "rc2-40");
+ break;
+ case 2:
+ mutt_str_replace (&SmimeCryptAlg, "rc2-64");
+ break;
+ case 3:
+ mutt_str_replace (&SmimeCryptAlg, "rc2-128");
+ break;
+ }
break;
- }
- break;
- case 3:
- switch (choice = mutt_multi_choice (_("1: AES128, 2: AES192, 3: AES256 "),
- _("895")))
- {
- case 1:
- mutt_str_replace (&SmimeCryptAlg, "aes128");
- break;
- case 2:
- mutt_str_replace (&SmimeCryptAlg, "aes192");
- break;
case 3:
- mutt_str_replace (&SmimeCryptAlg, "aes256");
+ switch (choice = mutt_multi_choice (_("1: AES128, 2: AES192, 3: AES256 "),
+ _("895")))
+ {
+ case 1:
+ mutt_str_replace (&SmimeCryptAlg, "aes128");
+ break;
+ case 2:
+ mutt_str_replace (&SmimeCryptAlg, "aes192");
+ break;
+ case 3:
+ mutt_str_replace (&SmimeCryptAlg, "aes256");
+ break;
+ }
break;
- }
- break;
- case 4: /* (c)lear */
- FREE (&SmimeCryptAlg);
- /* fallback */
- case -1: /* Ctrl-G or Enter */
- choice = 0;
- break;
+ case 4: /* (c)lear */
+ FREE (&SmimeCryptAlg);
+ /* fallback */
+ case -1: /* Ctrl-G or Enter */
+ choice = 0;
+ break;
}
} while (choice == -1);
}
break;
- case 's': /* (s)ign */
- msg->security &= ~ENCRYPT;
- msg->security |= SIGN;
- break;
+ case 's': /* (s)ign */
+ msg->security &= ~ENCRYPT;
+ msg->security |= SIGN;
+ break;
- case 'S': /* (s)ign in oppenc mode */
- msg->security |= SIGN;
- break;
+ case 'S': /* (s)ign in oppenc mode */
+ msg->security |= SIGN;
+ break;
- case 'a': /* sign (a)s */
+ case 'a': /* sign (a)s */
- if ((key = smime_ask_for_key (_("Sign as: "), KEYFLAG_CANSIGN, 0)))
- {
- mutt_str_replace (&SmimeSignAs, key->hash);
- smime_free_key (&key);
+ if ((key = smime_ask_for_key (_("Sign as: "), KEYFLAG_CANSIGN, 0)))
+ {
+ mutt_str_replace (&SmimeSignAs, key->hash);
+ smime_free_key (&key);
- msg->security |= SIGN;
+ msg->security |= SIGN;
- /* probably need a different passphrase */
- crypt_smime_void_passphrase ();
- }
+ /* probably need a different passphrase */
+ crypt_smime_void_passphrase ();
+ }
- break;
+ break;
- case 'b': /* (b)oth */
- msg->security |= (ENCRYPT | SIGN);
- break;
+ case 'b': /* (b)oth */
+ msg->security |= (ENCRYPT | SIGN);
+ break;
- case 'f': /* (f)orget it: kept for backward compatibility. */
- case 'c': /* (c)lear */
- msg->security &= ~(ENCRYPT | SIGN);
- break;
+ case 'f': /* (f)orget it: kept for backward compatibility. */
+ case 'c': /* (c)lear */
+ msg->security &= ~(ENCRYPT | SIGN);
+ break;
- case 'F': /* (f)orget it or (c)lear in oppenc mode */
- case 'C':
- msg->security &= ~SIGN;
- break;
+ case 'F': /* (f)orget it or (c)lear in oppenc mode */
+ case 'C':
+ msg->security &= ~SIGN;
+ break;
- case 'O': /* oppenc mode on */
- msg->security |= OPPENCRYPT;
- crypt_opportunistic_encrypt (msg);
- break;
+ case 'O': /* oppenc mode on */
+ msg->security |= OPPENCRYPT;
+ crypt_opportunistic_encrypt (msg);
+ break;
- case 'o': /* oppenc mode off */
- msg->security &= ~OPPENCRYPT;
- break;
+ case 'o': /* oppenc mode off */
+ msg->security &= ~OPPENCRYPT;
+ break;
}
}
return 0;
mutt_error (_("SMTP session failed: %s"), buf);
- return -1;
+ return -1;
}
static int
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.
- */
+ * repeatedly calls conn->write until all data is sent. This
+ * currently doesn't check for a short write.
+ */
if (mutt_socket_write (conn, buf) == -1)
return smtp_err_write;
return smtp_get_resp (conn);
/* function to use as discriminator when normal sort method is equal */
static sort_t *AuxSort = NULL;
-#define AUXSORT(code,a,b) if (!code && AuxSort && !option(OPTAUXSORT)) { \
- set_option(OPTAUXSORT); \
- code = AuxSort(a,b); \
- unset_option(OPTAUXSORT); \
- if (code) \
- return (code); \
-} \
-if (!code) \
- code = (*((HEADER **)a))->index - (*((HEADER **)b))->index;
+#define AUXSORT(code,a,b) \
+ if (!code && AuxSort && !option(OPTAUXSORT)) \
+ { \
+ set_option(OPTAUXSORT); \
+ code = AuxSort(a,b); \
+ unset_option(OPTAUXSORT); \
+ if (code) \
+ return (code); \
+ } \
+ if (!code) \
+ code = (*((HEADER **)a))->index - (*((HEADER **)b))->index;
static int compare_score (const void *a, const void *b)
{
case 'f':
snprintf (fmt, sizeof(fmt), "%%%ss", prefix);
#ifdef USE_COMPRESSED
- if (Context && Context->compress_info && Context->realpath) {
- strfcpy (tmp, Context->realpath, sizeof (tmp));
- mutt_pretty_mailbox (tmp, sizeof (tmp));
- } else
-#endif
- if (Context && Context->path)
+ if (Context && Context->compress_info && Context->realpath)
{
- strfcpy (tmp, Context->path, sizeof (tmp));
- mutt_pretty_mailbox (tmp, sizeof (tmp));
+ strfcpy (tmp, Context->realpath, sizeof (tmp));
+ mutt_pretty_mailbox (tmp, sizeof (tmp));
}
else
- strfcpy (tmp, _("(no mailbox)"), sizeof (tmp));
+#endif
+ if (Context && Context->path)
+ {
+ strfcpy (tmp, Context->path, sizeof (tmp));
+ mutt_pretty_mailbox (tmp, sizeof (tmp));
+ }
+ else
+ strfcpy (tmp, _("(no mailbox)"), sizeof (tmp));
snprintf (buf, buflen, fmt, tmp);
break;
myarrow[0] = vtee;
if (width == 2)
myarrow[1] = pseudo ? MUTT_TREE_STAR
- : (tree->duplicate_thread ? MUTT_TREE_EQUALS : MUTT_TREE_HLINE);
+ : (tree->duplicate_thread ? MUTT_TREE_EQUALS : MUTT_TREE_HLINE);
if (tree->visible)
{
myarrow[width] = MUTT_TREE_RARROW;
ctx->v2r[ctx->vcount] = i;
ctx->vcount++;
ctx->vsize += cur->content->length + cur->content->offset -
- cur->content->hdr_offset + padding;
+ cur->content->hdr_offset + padding;
cur->num_hidden = mutt_get_hidden (ctx, cur);
}
}
void
txt2c(char *sym, FILE *fp)
{
- unsigned char buf[per_line];
- int i;
- int sz = 0;
+ unsigned char buf[per_line];
+ int i;
+ int sz = 0;
- printf("unsigned char %s[] = {\n", sym);
- while (1) {
- sz = fread(buf, sizeof(unsigned char), per_line, fp);
- if (sz == 0)
- break;
- printf("\t");
- for (i = 0; i < sz; i++)
- printf("0x%02x, ", buf[i]);
- printf("\n");
- }
+ printf("unsigned char %s[] = {\n", sym);
+ while (1)
+ {
+ sz = fread(buf, sizeof(unsigned char), per_line, fp);
+ if (sz == 0)
+ break;
+ printf("\t");
+ for (i = 0; i < sz; i++)
+ printf("0x%02x, ", buf[i]);
+ printf("\n");
+ }
- printf("\t0x00\n};\n");
+ printf("\t0x00\n};\n");
}
int
main(int argc, char *argv[])
{
- if (argc != 2) {
- fprintf(stderr, "usage: %s symbol <textfile >textfile.c\n", argv[0]);
- return 2;
- }
+ if (argc != 2)
+ {
+ fprintf(stderr, "usage: %s symbol <textfile >textfile.c\n", argv[0]);
+ return 2;
+ }
- txt2c(argv[1], stdin);
- return 0;
+ txt2c(argv[1], stdin);
+ return 0;
}
else if (c < (1 << 11))
{
if (s && buflen >= 2)
- {
+ {
*s++ = 0xc0 | (c >> 6);
*s++ = 0x80 | (c & 0x3f);
}