From: Michael Elkins Date: Sun, 4 Apr 2010 03:34:04 +0000 (-0700) Subject: prevent user from setting $charset to an empty string since other code requires it... X-Git-Tag: mutt-1-5-21-rel~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a06352540e5cf8c200958b6d0032363a6972958;p=mutt prevent user from setting $charset to an empty string since other code requires it to be set to a valid string closes #3326 --- diff --git a/init.c b/init.c index 97dc7fcf..399153c2 100644 --- a/init.c +++ b/init.c @@ -1892,8 +1892,10 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err) } else if (DTYPE (MuttVars[idx].type) == DT_STR) { - if (strstr (MuttVars[idx].option, "charset") && - check_charset (&MuttVars[idx], tmp->data) < 0) + if ((strstr (MuttVars[idx].option, "charset") && + check_charset (&MuttVars[idx], tmp->data) < 0) | + /* $charset can't be empty, others can */ + (strcmp(MuttVars[idx].option, "charset") == 0 && ! *tmp->data)) { snprintf (err->data, err->dsize, _("Invalid value for option %s: \"%s\""), MuttVars[idx].option, tmp->data);