Commit 162cce19 authored by Antonio Radici's avatar Antonio Radici

New upstream version 1.7.0

parent 3fcb821b
......@@ -8,7 +8,7 @@ have been helpful with the development of this program. Please also
see our source code repository at http://dev.mutt.org/hg/mutt/ for
the full history of commits.
Copyright (C) 1996-2014 Michael R. Elkins <me@cs.hmc.edu>
Copyright (C) 1996-2016 Michael R. Elkins <me@cs.hmc.edu>
Copyright (C) 1996-2002 Brandon Long <blong@fiction.net>
Copyright (C) 1997-2009 Thomas Roessler <roessler@does-not-exist.org>
Copyright (C) 1998-2005 Werner Koch <wk@isil.d.shuttle.de>
......@@ -16,7 +16,7 @@ Copyright (C) 1999-2014 Brendan Cully <brendan@kublai.com>
Copyright (C) 1999-2002 Tommi Komulainen <Tommi.Komulainen@iki.fi>
Copyright (C) 2000-2004 Edmund Grimley Evans <edmundo@rano.org>
Copyright (C) 2006-2009 Rocco Rutte <pdmef@gmx.net>
Copyright (C) 2014-2015 Kevin J. McCarthy <kevin@8t8.us>
Copyright (C) 2014-2016 Kevin J. McCarthy <kevin@8t8.us>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
This diff is collapsed.
......@@ -56,7 +56,7 @@ EXTRA_mutt_SOURCES = account.c bcache.c crypt-gpgme.c crypt-mod-pgp-classic.c \
mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \
pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \
smime.c smtp.c utf8.c wcwidth.c \
sidebar.c smime.c smtp.c utf8.c wcwidth.c \
bcache.h browser.h hcache.h mbyte.h mutt_idna.h remailer.h url.h
EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
......@@ -71,8 +71,8 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \
README.SSL smime.h group.h \
muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
ChangeLog mkchangelog.sh mutt_idna.h \
snprintf.c regex.c crypt-gpgme.h hcachever.sh.in sys_socket.h \
ChangeLog mkchangelog.sh mutt_idna.h sidebar.h OPS.SIDEBAR \
snprintf.c regex.c crypt-gpgme.h hcachever.sh.in \
txt2c.c txt2c.sh version.sh check_sec.sh
EXTRA_SCRIPTS = smime_keys
......@@ -99,9 +99,9 @@ mutt_dotlock.c: dotlock.c
conststrings.c: txt2c config.status
( \
$(CC) -v || \
$(CC) --version || \
$(CC) -V || \
($(CC) -v >/dev/null 2>&1 && $(CC) -v) || \
($(CC) --version >/dev/null 2>&1 && $(CC) --version) || \
($(CC) -V >/dev/null 2>&1 && $(CC) -V) || \
echo "unknown compiler"; \
) 2>&1 | ${srcdir}/txt2c.sh cc_version >conststrings_c
echo "$(CFLAGS)" | ${srcdir}/txt2c.sh cc_cflags >>conststrings_c
......@@ -129,9 +129,9 @@ smime_keys: $(srcdir)/smime_keys.pl
keymap_defs.h: $(OPS) $(srcdir)/gen_defs
$(srcdir)/gen_defs $(OPS) > keymap_defs.h
keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.SIDEBAR $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
rm -f $@
$(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.PGP \
$(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.SIDEBAR $(srcdir)/OPS.PGP \
$(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
> keymap_alldefs.h
......
......@@ -503,7 +503,7 @@ EXTRA_mutt_SOURCES = account.c bcache.c crypt-gpgme.c crypt-mod-pgp-classic.c \
mutt_idna.c mutt_sasl.c mutt_socket.c mutt_ssl.c mutt_ssl_gnutls.c \
mutt_tunnel.c pgp.c pgpinvoke.c pgpkey.c pgplib.c pgpmicalg.c \
pgppacket.c pop.c pop_auth.c pop_lib.c remailer.c resize.c sha1.c \
smime.c smtp.c utf8.c wcwidth.c \
sidebar.c smime.c smtp.c utf8.c wcwidth.c \
bcache.h browser.h hcache.h mbyte.h mutt_idna.h remailer.h url.h
EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
......@@ -518,8 +518,8 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP OPS.CRYPT OPS.SMIME TODO UPDATING \
mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \
README.SSL smime.h group.h \
muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
ChangeLog mkchangelog.sh mutt_idna.h \
snprintf.c regex.c crypt-gpgme.h hcachever.sh.in sys_socket.h \
ChangeLog mkchangelog.sh mutt_idna.h sidebar.h OPS.SIDEBAR \
snprintf.c regex.c crypt-gpgme.h hcachever.sh.in \
txt2c.c txt2c.sh version.sh check_sec.sh
EXTRA_SCRIPTS = smime_keys
......@@ -815,6 +815,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/send.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendlib.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sidebar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smime.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp.Po@am__quote@
......@@ -1306,9 +1307,9 @@ mutt_dotlock.c: dotlock.c
conststrings.c: txt2c config.status
( \
$(CC) -v || \
$(CC) --version || \
$(CC) -V || \
($(CC) -v >/dev/null 2>&1 && $(CC) -v) || \
($(CC) --version >/dev/null 2>&1 && $(CC) --version) || \
($(CC) -V >/dev/null 2>&1 && $(CC) -V) || \
echo "unknown compiler"; \
) 2>&1 | ${srcdir}/txt2c.sh cc_version >conststrings_c
echo "$(CFLAGS)" | ${srcdir}/txt2c.sh cc_cflags >>conststrings_c
......@@ -1328,9 +1329,9 @@ smime_keys: $(srcdir)/smime_keys.pl
keymap_defs.h: $(OPS) $(srcdir)/gen_defs
$(srcdir)/gen_defs $(OPS) > keymap_defs.h
keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
keymap_alldefs.h: $(srcdir)/OPS $(srcdir)/OPS.SIDEBAR $(srcdir)/OPS.PGP $(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME $(srcdir)/gen_defs
rm -f $@
$(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.PGP \
$(srcdir)/gen_defs $(srcdir)/OPS $(srcdir)/OPS.SIDEBAR $(srcdir)/OPS.PGP \
$(srcdir)/OPS.MIX $(srcdir)/OPS.CRYPT $(srcdir)/OPS.SMIME \
> keymap_alldefs.h
......
......@@ -142,6 +142,7 @@ OP_PREV_ENTRY "move to the previous entry"
OP_PREV_LINE "scroll up one line"
OP_PREV_PAGE "move to the previous page"
OP_PRINT "print the current entry"
OP_PURGE_MESSAGE "really delete the current entry, bypassing the trash folder"
OP_QUERY "query external program for addresses"
OP_QUERY_APPEND "append new query results to current results"
OP_QUIT "save changes to mailbox and quit"
......
OP_MIX_USE "Accept the chain constructed"
OP_MIX_APPEND "Append a remailer to the chain"
OP_MIX_INSERT "Insert a remailer into the chain"
OP_MIX_DELETE "Delete a remailer from the chain"
OP_MIX_CHAIN_PREV "Select the previous element of the chain"
OP_MIX_CHAIN_NEXT "Select the next element of the chain"
OP_MIX_USE "accept the chain constructed"
OP_MIX_APPEND "append a remailer to the chain"
OP_MIX_INSERT "insert a remailer into the chain"
OP_MIX_DELETE "delete a remailer from the chain"
OP_MIX_CHAIN_PREV "select the previous element of the chain"
OP_MIX_CHAIN_NEXT "select the next element of the chain"
OP_COMPOSE_MIX "send the message through a mixmaster remailer chain"
OP_SIDEBAR_NEXT "move the highlight to next mailbox"
OP_SIDEBAR_NEXT_NEW "move the highlight to next mailbox with new mail"
OP_SIDEBAR_OPEN "open highlighted mailbox"
OP_SIDEBAR_PAGE_DOWN "scroll the sidebar down 1 page"
OP_SIDEBAR_PAGE_UP "scroll the sidebar up 1 page"
OP_SIDEBAR_PREV "move the highlight to previous mailbox"
OP_SIDEBAR_PREV_NEW "move the highlight to previous mailbox with new mail"
OP_SIDEBAR_TOGGLE_VISIBLE "make the sidebar (in)visible"
......@@ -4,6 +4,32 @@ mutt. Please read this file carefully when upgrading your installation.
The keys used are:
!: modified feature, -: deleted feature, +: new feature
1.7.0 (2016-08-18):
! Improved alignment when using multi-column characters with
soft-fill (%*X) and right-justified (%>X) format strings.
+ The COLUMNS environment variable will be set to the width of the
pager when invoking display filters. This can be used in
copiousoutput mailcap entries to allow their output to match the
pager width.
+ The sidebar patch has been merged. Please watch for airborne
bovine. See the documentation for all the options, or simply
enable it with 'set sidebar_visible'.
+ $mail_check_stats and $mail_check_stats_interval control whether,
and how often, to scan for unread, flagged, and total message
counts when checking for new mail in mailboxes. These statistics
can be displayed in the sidebar and browser.
+ $trash, when set, specifies the path of the folder where mails
marked for deletion will be moved, instead of being irremediably
purged.
+ The <purge-message> function can be used to delete an entry and
bypass the trash folder.
+ $folder_format has new format strings %m and %n, to display
total and unread message counts for mailboxes. Note that
$mail_check_stats should be enabled to use these.
! When browsing IMAP, %N will now display 'N', instead of the unread
message count. Please use %n to display unread messages.
1.6.2 (2016-07-06):
! Bug fix release. No features were modified or added.
......
......@@ -39,7 +39,7 @@ int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* a2)
return 0;
#ifdef USE_IMAP
if (a1->type == M_ACCT_TYPE_IMAP)
if (a1->type == MUTT_ACCT_TYPE_IMAP)
{
if (ImapUser)
user = ImapUser;
......@@ -47,15 +47,15 @@ int mutt_account_match (const ACCOUNT* a1, const ACCOUNT* a2)
#endif
#ifdef USE_POP
if (a1->type == M_ACCT_TYPE_POP && PopUser)
if (a1->type == MUTT_ACCT_TYPE_POP && PopUser)
user = PopUser;
#endif
if (a1->flags & a2->flags & M_ACCT_USER)
if (a1->flags & a2->flags & MUTT_ACCT_USER)
return (!strcmp (a1->user, a2->user));
if (a1->flags & M_ACCT_USER)
if (a1->flags & MUTT_ACCT_USER)
return (!strcmp (a1->user, user));
if (a2->flags & M_ACCT_USER)
if (a2->flags & MUTT_ACCT_USER)
return (!strcmp (a2->user, user));
return 1;
......@@ -73,17 +73,17 @@ int mutt_account_fromurl (ACCOUNT* account, ciss_url_t* url)
if (url->user)
{
strfcpy (account->user, url->user, sizeof (account->user));
account->flags |= M_ACCT_USER;
account->flags |= MUTT_ACCT_USER;
}
if (url->pass)
{
strfcpy (account->pass, url->pass, sizeof (account->pass));
account->flags |= M_ACCT_PASS;
account->flags |= MUTT_ACCT_PASS;
}
if (url->port)
{
account->port = url->port;
account->flags |= M_ACCT_PORT;
account->flags |= MUTT_ACCT_PORT;
}
return 0;
......@@ -101,9 +101,9 @@ void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
url->port = 0;
#ifdef USE_IMAP
if (account->type == M_ACCT_TYPE_IMAP)
if (account->type == MUTT_ACCT_TYPE_IMAP)
{
if (account->flags & M_ACCT_SSL)
if (account->flags & MUTT_ACCT_SSL)
url->scheme = U_IMAPS;
else
url->scheme = U_IMAP;
......@@ -111,9 +111,9 @@ void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
#endif
#ifdef USE_POP
if (account->type == M_ACCT_TYPE_POP)
if (account->type == MUTT_ACCT_TYPE_POP)
{
if (account->flags & M_ACCT_SSL)
if (account->flags & MUTT_ACCT_SSL)
url->scheme = U_POPS;
else
url->scheme = U_POP;
......@@ -121,9 +121,9 @@ void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
#endif
#ifdef USE_SMTP
if (account->type == M_ACCT_TYPE_SMTP)
if (account->type == MUTT_ACCT_TYPE_SMTP)
{
if (account->flags & M_ACCT_SSL)
if (account->flags & MUTT_ACCT_SSL)
url->scheme = U_SMTPS;
else
url->scheme = U_SMTP;
......@@ -131,11 +131,11 @@ void mutt_account_tourl (ACCOUNT* account, ciss_url_t* url)
#endif
url->host = account->host;
if (account->flags & M_ACCT_PORT)
if (account->flags & MUTT_ACCT_PORT)
url->port = account->port;
if (account->flags & M_ACCT_USER)
if (account->flags & MUTT_ACCT_USER)
url->user = account->user;
if (account->flags & M_ACCT_PASS)
if (account->flags & MUTT_ACCT_PASS)
url->pass = account->pass;
}
......@@ -145,14 +145,14 @@ int mutt_account_getuser (ACCOUNT* account)
char prompt[SHORT_STRING];
/* already set */
if (account->flags & M_ACCT_USER)
if (account->flags & MUTT_ACCT_USER)
return 0;
#ifdef USE_IMAP
else if ((account->type == M_ACCT_TYPE_IMAP) && ImapUser)
else if ((account->type == MUTT_ACCT_TYPE_IMAP) && ImapUser)
strfcpy (account->user, ImapUser, sizeof (account->user));
#endif
#ifdef USE_POP
else if ((account->type == M_ACCT_TYPE_POP) && PopUser)
else if ((account->type == MUTT_ACCT_TYPE_POP) && PopUser)
strfcpy (account->user, PopUser, sizeof (account->user));
#endif
else if (option (OPTNOCURSES))
......@@ -166,7 +166,7 @@ int mutt_account_getuser (ACCOUNT* account)
return -1;
}
account->flags |= M_ACCT_USER;
account->flags |= MUTT_ACCT_USER;
return 0;
}
......@@ -174,26 +174,26 @@ int mutt_account_getuser (ACCOUNT* account)
int mutt_account_getlogin (ACCOUNT* account)
{
/* already set */
if (account->flags & M_ACCT_LOGIN)
if (account->flags & MUTT_ACCT_LOGIN)
return 0;
#ifdef USE_IMAP
else if (account->type == M_ACCT_TYPE_IMAP)
else if (account->type == MUTT_ACCT_TYPE_IMAP)
{
if (ImapLogin)
{
strfcpy (account->login, ImapLogin, sizeof (account->login));
account->flags |= M_ACCT_LOGIN;
account->flags |= MUTT_ACCT_LOGIN;
}
}
#endif
if (!(account->flags & M_ACCT_LOGIN))
if (!(account->flags & MUTT_ACCT_LOGIN))
{
mutt_account_getuser (account);
strfcpy (account->login, account->user, sizeof (account->login));
}
account->flags |= M_ACCT_LOGIN;
account->flags |= MUTT_ACCT_LOGIN;
return 0;
}
......@@ -203,18 +203,18 @@ int mutt_account_getpass (ACCOUNT* account)
{
char prompt[SHORT_STRING];
if (account->flags & M_ACCT_PASS)
if (account->flags & MUTT_ACCT_PASS)
return 0;
#ifdef USE_IMAP
else if ((account->type == M_ACCT_TYPE_IMAP) && ImapPass)
else if ((account->type == MUTT_ACCT_TYPE_IMAP) && ImapPass)
strfcpy (account->pass, ImapPass, sizeof (account->pass));
#endif
#ifdef USE_POP
else if ((account->type == M_ACCT_TYPE_POP) && PopPass)
else if ((account->type == MUTT_ACCT_TYPE_POP) && PopPass)
strfcpy (account->pass, PopPass, sizeof (account->pass));
#endif
#ifdef USE_SMTP
else if ((account->type == M_ACCT_TYPE_SMTP) && SmtpPass)
else if ((account->type == MUTT_ACCT_TYPE_SMTP) && SmtpPass)
strfcpy (account->pass, SmtpPass, sizeof (account->pass));
#endif
else if (option (OPTNOCURSES))
......@@ -222,19 +222,19 @@ int mutt_account_getpass (ACCOUNT* account)
else
{
snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "),
account->flags & M_ACCT_LOGIN ? account->login : account->user,
account->flags & MUTT_ACCT_LOGIN ? account->login : account->user,
account->host);
account->pass[0] = '\0';
if (mutt_get_password (prompt, account->pass, sizeof (account->pass)))
return -1;
}
account->flags |= M_ACCT_PASS;
account->flags |= MUTT_ACCT_PASS;
return 0;
}
void mutt_account_unsetpass (ACCOUNT* account)
{
account->flags &= ~M_ACCT_PASS;
account->flags &= ~MUTT_ACCT_PASS;
}
......@@ -26,18 +26,18 @@
/* account types */
enum
{
M_ACCT_TYPE_NONE = 0,
M_ACCT_TYPE_IMAP,
M_ACCT_TYPE_POP,
M_ACCT_TYPE_SMTP
MUTT_ACCT_TYPE_NONE = 0,
MUTT_ACCT_TYPE_IMAP,
MUTT_ACCT_TYPE_POP,
MUTT_ACCT_TYPE_SMTP
};
/* account flags */
#define M_ACCT_PORT (1<<0)
#define M_ACCT_USER (1<<1)
#define M_ACCT_LOGIN (1<<2)
#define M_ACCT_PASS (1<<3)
#define M_ACCT_SSL (1<<4)
#define MUTT_ACCT_PORT (1<<0)
#define MUTT_ACCT_USER (1<<1)
#define MUTT_ACCT_LOGIN (1<<2)
#define MUTT_ACCT_PASS (1<<3)
#define MUTT_ACCT_SSL (1<<4)
typedef struct
{
......
......@@ -43,7 +43,7 @@ static const struct mapping_t AliasHelp[] = {
};
static const char *
alias_format_str (char *dest, size_t destlen, size_t col, char op, const char *src,
alias_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)
{
......@@ -80,7 +80,7 @@ alias_format_str (char *dest, size_t destlen, size_t col, char op, const char *s
static void alias_entry (char *s, size_t slen, MUTTMENU *m, int num)
{
mutt_FormatString (s, slen, 0, NONULL (AliasFmt), alias_format_str, (unsigned long) ((ALIAS **) m->data)[num], M_FORMAT_ARROWCURSOR);
mutt_FormatString (s, slen, 0, MuttIndexWindow->cols, NONULL (AliasFmt), alias_format_str, (unsigned long) ((ALIAS **) m->data)[num], MUTT_FORMAT_ARROWCURSOR);
}
static int alias_tag (MUTTMENU *menu, int n, int m)
......
......@@ -269,9 +269,9 @@ retry_name:
if (mutt_check_alias_name (buf, fixed, sizeof (fixed)))
{
switch (mutt_yesorno (_("Warning: This alias name may not work. Fix it?"), M_YES))
switch (mutt_yesorno (_("Warning: This alias name may not work. Fix it?"), MUTT_YES))
{
case M_YES:
case MUTT_YES:
strfcpy (buf, fixed, sizeof (buf));
goto retry_name;
case -1:
......@@ -326,7 +326,7 @@ retry_name:
buf[0] = 0;
rfc822_write_address (buf, sizeof (buf), new->addr, 1);
snprintf (prompt, sizeof (prompt), _("[%s = %s] Accept?"), new->name, buf);
if (mutt_yesorno (prompt, M_YES) != M_YES)
if (mutt_yesorno (prompt, MUTT_YES) != MUTT_YES)
{
mutt_free_alias (&new);
return;
......@@ -344,7 +344,7 @@ retry_name:
Aliases = new;
strfcpy (buf, NONULL (AliasFile), sizeof (buf));
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf), M_FILE) != 0)
if (mutt_get_field (_("Save to file: "), buf, sizeof (buf), MUTT_FILE) != 0)
return;
mutt_expand_path (buf, sizeof (buf));
if ((rc = fopen (buf, "a+")))
......@@ -423,6 +423,8 @@ int mutt_check_alias_name (const char *s, char *dest, size_t destlen)
{
if (dry)
return -1;
if (l == (size_t)(-1))
memset (&mb, 0, sizeof (mbstate_t));
*dest++ = '_';
rv = -1;
}
......
......@@ -94,7 +94,7 @@ int mutt_compose_attachment (BODY *a)
int rc = 0;
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (rfc1524_mailcap_lookup (a, type, entry, M_COMPOSE))
if (rfc1524_mailcap_lookup (a, type, entry, MUTT_COMPOSE))
{
if (entry->composecommand || entry->composetypecommand)
{
......@@ -110,7 +110,7 @@ int mutt_compose_attachment (BODY *a)
a->filename, newfile));
if (safe_symlink (a->filename, newfile) == -1)
{
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES)
goto bailout;
}
else
......@@ -229,7 +229,7 @@ int mutt_edit_attachment (BODY *a)
int rc = 0;
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (rfc1524_mailcap_lookup (a, type, entry, M_EDIT))
if (rfc1524_mailcap_lookup (a, type, entry, MUTT_EDIT))
{
if (entry->editcommand)
{
......@@ -242,7 +242,7 @@ int mutt_edit_attachment (BODY *a)
a->filename, newfile));
if (safe_symlink (a->filename, newfile) == -1)
{
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES)
goto bailout;
}
else
......@@ -350,8 +350,8 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
if (WithCrypto && is_message && a->hdr && (a->hdr->security & ENCRYPT) &&
!crypt_valid_passphrase(a->hdr->security))
return (rc);
use_mailcap = (flag == M_MAILCAP ||
(flag == M_REGULAR && mutt_needs_mailcap (a)));
use_mailcap = (flag == MUTT_MAILCAP ||
(flag == MUTT_REGULAR && mutt_needs_mailcap (a)));
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (use_mailcap)
......@@ -359,12 +359,12 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
entry = rfc1524_new_entry ();
if (!rfc1524_mailcap_lookup (a, type, entry, 0))
{
if (flag == M_REGULAR)
if (flag == MUTT_REGULAR)
{
/* fallback to view as text */
rfc1524_free_entry (&entry);
mutt_error _("No matching mailcap entry found. Viewing as text.");
flag = M_AS_TEXT;
flag = MUTT_AS_TEXT;
use_mailcap = 0;
}
else
......@@ -397,7 +397,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
/* send case: the file is already there */
if (safe_symlink (a->filename, tempfile) == -1)
{
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) == M_YES)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) == MUTT_YES)
strfcpy (tempfile, a->filename, sizeof (tempfile));
else
goto return_error;
......@@ -502,7 +502,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
{
/* Don't use mailcap; the attachment is viewed in the pager */
if (flag == M_AS_TEXT)
if (flag == MUTT_AS_TEXT)
{
/* just let me see the raw data */
if (fp)
......@@ -524,7 +524,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
goto return_error;
}
decode_state.fpin = fp;
decode_state.flags = M_CHARCONV;
decode_state.flags = MUTT_CHARCONV;
mutt_decode_attachment(a, &decode_state);
if (fclose(decode_state.fpout) == EOF)
dprint(1, (debugfile, "mutt_view_attachment:%d fclose errno=%d %s\n", __LINE__, pagerfile, errno, strerror(errno)));
......@@ -544,7 +544,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
/* Use built-in handler */
set_option (OPTVIEWATTACH); /* disable the "use 'v' to view this part"
* message in case of error */
if (mutt_decode_save_attachment (fp, a, pagerfile, M_DISPLAY, 0))
if (mutt_decode_save_attachment (fp, a, pagerfile, MUTT_DISPLAY, 0))
{
unset_option (OPTVIEWATTACH);
goto return_error;
......@@ -576,7 +576,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr,
info.hdr = hdr;
rc = mutt_do_pager (descrip, pagerfile,
M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0), &info);
MUTT_PAGER_ATTACHMENT | (is_message ? MUTT_PAGER_MESSAGE : 0), &info);
*pagerfile = '\0';
}
else
......@@ -691,9 +691,9 @@ bail:
static FILE *
mutt_save_attachment_open (char *path, int flags)
{
if (flags == M_SAVE_APPEND)
if (flags == MUTT_SAVE_APPEND)
return fopen (path, "a");
if (flags == M_SAVE_OVERWRITE)
if (flags == MUTT_SAVE_OVERWRITE)
return fopen (path, "w"); /* __FOPEN_CHECKED__ */
return safe_fopen (path, "w");
......@@ -729,23 +729,23 @@ int mutt_save_attachment (FILE *fp, BODY *m, char *path, int flags, HEADER *hdr)
fseeko (fp, m->offset, 0);
if (fgets (buf, sizeof (buf), fp) == NULL)
return -1;
if (mx_open_mailbox(path, M_APPEND | M_QUIET, &ctx) == NULL)
if (mx_open_mailbox(path, MUTT_APPEND | MUTT_QUIET, &ctx) == NULL)
return -1;
if ((msg = mx_open_new_message (&ctx, hn, is_from (buf, NULL, 0, NULL) ? 0 : M_ADD_FROM)) == NULL)
if ((msg = mx_open_new_message (&ctx, hn, is_from (buf, NULL, 0, NULL) ? 0 : MUTT_ADD_FROM)) == NULL)
{
mx_close_mailbox(&ctx, NULL);
return -1;
}
if (ctx.magic == M_MBOX || ctx.magic == M_MMDF)
if (ctx.magic == MUTT_MBOX || ctx.magic == MUTT_MMDF)
chflags = CH_FROM | CH_UPDATE_LEN;
chflags |= (ctx.magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
chflags |= (ctx.magic == MUTT_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
if (_mutt_copy_message (msg->fp, fp, hn, hn->content, 0, chflags) == 0
&& mx_commit_message (msg, &ctx) == 0)
r = 0;
else
r = -1;
mx_close_message (&msg);
mx_close_message (&ctx, &msg);
mx_close_mailbox (&ctx, NULL);
return r;
}
......@@ -818,9 +818,9 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
memset (&s, 0, sizeof (s));
s.flags = displaying;
if (flags == M_SAVE_APPEND)
if (flags == MUTT_SAVE_APPEND)
s.fpout = fopen (path, "a");
else if (flags == M_SAVE_OVERWRITE)
else if (flags == MUTT_SAVE_OVERWRITE)
s.fpout = fopen (path, "w"); /* __FOPEN_CHECKED__ */
else
s.fpout = safe_fopen (path, "w");
......@@ -861,12 +861,12 @@ int mutt_decode_save_attachment (FILE *fp, BODY *m, char *path,
mutt_parse_part (s.fpin, m);
if (m->noconv || is_multipart (m))
s.flags |= M_CHARCONV;
s.flags |= MUTT_CHARCONV;
}
else
{
s.fpin = fp;
s.flags |= M_CHARCONV;
s.flags |= MUTT_CHARCONV;
}
mutt_body_handler (m, &s);
......@@ -905,7 +905,7 @@ int mutt_print_attachment (FILE *fp, BODY *a)
snprintf (type, sizeof (type), "%s/%s", TYPE (a), a->subtype);
if (rfc1524_mailcap_lookup (a, type, NULL, M_PRINT))
if (rfc1524_mailcap_lookup (a, type, NULL, MUTT_PRINT))
{
char command[_POSIX_PATH_MAX+STRING];
rfc1524_entry *entry;
......@@ -914,7 +914,7 @@ int mutt_print_attachment (FILE *fp, BODY *a)
dprint (2, (debugfile, "Using mailcap...\n"));
entry = rfc1524_new_entry ();
rfc1524_mailcap_lookup (a, type, entry, M_PRINT);
rfc1524_mailcap_lookup (a, type, entry, MUTT_PRINT);
if (rfc1524_expand_filename (entry->nametemplate, a->filename,
newfile, sizeof (newfile)))
{
......@@ -922,7 +922,7 @@ int mutt_print_attachment (FILE *fp, BODY *a)
{
if (safe_symlink(a->filename, newfile) == -1)
{
if (mutt_yesorno (_("Can't match nametemplate, continue?"), M_YES) != M_YES)
if (mutt_yesorno (_("Can't match nametemplate, continue?"), MUTT_YES) != MUTT_YES)
{
rfc1524_free_entry (&entry);
return 0;
......@@ -996,7 +996,7 @@ int mutt_print_attachment (FILE *fp, BODY *a)
fpout = NULL;
mutt_mktemp (newfile, sizeof (newfile));
if (mutt_decode_save_attachment (fp, a, newfile, M_PRINTING, 0) == 0)
if (mutt_decode_save_attachment (fp, a, newfile, MUTT_PRINTING, 0) == 0)
{
dprint (2, (debugfile, "successfully decoded %s type attachment to %s\n",
......
This diff is collapsed.