1. Steve Losh
  2. hg-review-mutt-test

Commits

Michael Elkins  committed cf97505

prevent user from setting $charset to an empty string since other code requires it to be set to a valid string

closes #3326

  • Participants
  • Parent commits b592852
  • Branches HEAD

Comments (0)

Files changed (1)

File init.c

View file
         }
         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);