From 59c49d57d21de8d9e1ca25ab291175fbe18b6399 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Thu, 16 Aug 2018 14:15:50 +0100 Subject: [PATCH] config: workaround for mailboxes --- config/dump.c | 4 ++-- config/types.h | 2 ++ conn/conn_globals.c | 2 +- init.c | 2 +- init.h | 12 ++++++------ po/POTFILES.in | 1 + 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/config/dump.c b/config/dump.c index 4811543bd9c..e480424ff08 100644 --- a/config/dump.c +++ b/config/dump.c @@ -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)) diff --git a/config/types.h b/config/types.h index 3fc0edb61f0..b1cf353dc54 100644 --- a/config/types.h +++ b/config/types.h @@ -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 */ diff --git a/conn/conn_globals.c b/conn/conn_globals.c index 2811914c375..6b21dcb5373 100644 --- a/conn/conn_globals.c +++ b/conn/conn_globals.c @@ -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 diff --git a/init.c b/init.c index cfb7260106f..73cc04744fc 100644 --- a/init.c +++ b/init.c @@ -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 */ diff --git a/init.h b/init.h index aded50eb205..dd1cfd4bfd3 100644 --- a/init.h +++ b/init.h @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/po/POTFILES.in b/po/POTFILES.in index 841b5f467f6..ee05091d153 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -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