]> granicus.if.org Git - neomutt/commitdiff
Prevent $charset from having multiple values
authorRichard Russon <rich@flatcap.org>
Mon, 10 Dec 2018 14:26:28 +0000 (14:26 +0000)
committerRichard Russon <rich@flatcap.org>
Mon, 10 Dec 2018 14:53:11 +0000 (14:53 +0000)
init.c

diff --git a/init.c b/init.c
index fa5cb1ca50bcf27a2e3dd0559f2612146e512146..83e1d4aa883f6e81577d13c3e6b7a060ad1b2610 100644 (file)
--- a/init.c
+++ b/init.c
@@ -3702,6 +3702,13 @@ int charset_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef,
 
   const char *str = (const char *) value;
 
+  if ((strcmp(cdef->name, "charset") == 0) && strchr(str, ':'))
+  {
+    mutt_buffer_printf(err,
+                       _("'charset' must contain exactly one character set name"));
+    return CSR_ERR_INVALID;
+  }
+
   int rc = CSR_SUCCESS;
   bool strict = (strcmp(cdef->name, "send_charset") == 0);
   char *q = NULL;