Skip to content

Commit

Permalink
config: workaround for mailboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Aug 16, 2018
1 parent 8d22383 commit 59c49d5
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions config/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ bool dump_config(struct ConfigSet *cs, int style, int flags)
mutt_buffer_addstr(value, "***");
}

// if (type == DT_PATH)
// mutt_pretty_mailbox(value->data, value->dsize);
if ((type == DT_PATH) && (value->data[0] == '/'))
mutt_pretty_mailbox(value->data, value->dsize);

if ((type != DT_BOOL) && (type != DT_NUMBER) && (type != DT_QUAD) &&
!(flags & CS_DUMP_NO_ESCAPING))
Expand Down
2 changes: 2 additions & 0 deletions config/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#define DT_NOT_EMPTY 0x40 /**< Empty strings are not allowed */
#define DT_NOT_NEGATIVE 0x80 /**< Negative numbers are not allowed */

#define DT_MAILBOX 0x40 /**< DT_PATH: Don't perform path expansions */

/* subtypes for... */
#define DT_SUBTYPE_MASK 0xfe0 /**< Mask for the Data Subtype */

Expand Down
2 changes: 1 addition & 1 deletion conn/conn_globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const char *Tunnel = NULL; ///< Config: Shell command to establish a tunnel
#endif

#ifdef USE_SSL
bool SslUseSslv3; ///< Config: (ssl) INSECURE: Use SSLv3 for authentication
bool SslUseSslv3; ///< Config: (ssl) INSECURE: Use SSLv3 for authentication
bool SslUseTlsv1; ///< Config: (ssl) Use TLSv1 for authentication
bool SslUseTlsv11; ///< Config: (ssl) Use TLSv1.1 for authentication
bool SslUseTlsv12; ///< Config: (ssl) Use TLSv1.2 for authentication
Expand Down
2 changes: 1 addition & 1 deletion init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ static int parse_set(struct Buffer *buf, struct Buffer *s, unsigned long data,
char scratch[PATH_MAX];
mutt_str_strfcpy(scratch, buf->data, sizeof(scratch));
size_t scratchlen = mutt_str_strlen(scratch);
if (scratchlen != 0)
if (!(he->type & DT_MAILBOX) && (scratchlen != 0))
{
if ((scratch[scratchlen - 1] != '|') && /* not a command */
(url_check_scheme(scratch) == U_UNKNOWN)) /* probably a local file */
Expand Down
12 changes: 6 additions & 6 deletions init.h
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ struct ConfigDef MuttVars[] = {
** .pp
** If set, flagged messages cannot be deleted.
*/
{ "folder", DT_PATH, R_NONE, &Folder, IP "~/Mail" },
{ "folder", DT_PATH|DT_MAILBOX, R_NONE, &Folder, IP "~/Mail" },
/*
** .pp
** Specifies the default location of your mailboxes. A ``+'' or ``='' at the
Expand Down Expand Up @@ -1819,7 +1819,7 @@ struct ConfigDef MuttVars[] = {
** the \fInot\fP operator ``!''. Only files whose names match this mask
** will be shown. The match is always case-sensitive.
*/
{ "mbox", DT_PATH, R_BOTH, &Mbox, IP "~/mbox" },
{ "mbox", DT_PATH|DT_MAILBOX, R_BOTH, &Mbox, IP "~/mbox" },
/*
** .pp
** This specifies the folder into which read mail in your $$spoolfile
Expand Down Expand Up @@ -2826,7 +2826,7 @@ struct ConfigDef MuttVars[] = {
** Please use $$pgp_default_key or $$smime_default_key.
** (Crypto only)
*/
{ "postponed", DT_PATH, R_INDEX, &Postponed, IP "~/postponed" },
{ "postponed", DT_PATH|DT_MAILBOX, R_INDEX, &Postponed, IP "~/postponed" },
/*
** .pp
** NeoMutt allows you to indefinitely ``$postpone sending a message'' which
Expand Down Expand Up @@ -3001,7 +3001,7 @@ struct ConfigDef MuttVars[] = {
** .pp
** Also see $$postponed variable.
*/
{ "record", DT_PATH, R_NONE, &Record, IP "~/sent" },
{ "record", DT_PATH|DT_MAILBOX, R_NONE, &Record, IP "~/sent" },
/*
** .pp
** This specifies the file into which your outgoing messages should be
Expand Down Expand Up @@ -3934,7 +3934,7 @@ struct ConfigDef MuttVars[] = {
** match will append to the previous, using this variable's value as a
** separator.
*/
{ "spoolfile", DT_PATH, R_NONE, &Spoolfile, 0 },
{ "spoolfile", DT_PATH|DT_MAILBOX, R_NONE, &Spoolfile, 0 },
/*
** .pp
** If your spool mailbox is in a non-default place where NeoMutt cannot find
Expand Down Expand Up @@ -4282,7 +4282,7 @@ struct ConfigDef MuttVars[] = {
** .dt 6 .dd L .dd Indicates the mail was sent to a mailing-list you subscribe to.
** .de
*/
{ "trash", DT_PATH, R_NONE, &Trash, 0 },
{ "trash", DT_PATH|DT_MAILBOX, R_NONE, &Trash, 0 },
/*
** .pp
** If set, this variable specifies the path of the trash folder where the
Expand Down
1 change: 1 addition & 0 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ mutt/mapping.c
mutt/mbyte.c
mutt/md5.c
mutt/memory.c
mutt/path.c
mutt/regex.c
mutt/sha1.c
mutt/signal.c
Expand Down

0 comments on commit 59c49d5

Please sign in to comment.