- set_option (MuttVars[idx].data);
- }
- else if (DTYPE (MuttVars[idx].type) == DT_STR ||
- DTYPE (MuttVars[idx].type) == DT_PATH ||
- DTYPE (MuttVars[idx].type) == DT_ADDR) {
- if (unset) {
- if (DTYPE (MuttVars[idx].type) == DT_ADDR)
- rfc822_free_address ((ADDRESS **) MuttVars[idx].data);
- else
- mem_free ((void *) MuttVars[idx].data);
- }
- else if (query || *s->dptr != '=') {
- FuncTable[DTYPE (MuttVars[idx].type)].opt_to_string (err->data, err->dsize, idx);
- break;
- }
- else {
- s->dptr++;
-
- /* copy the value of the string */
- if (DTYPE (MuttVars[idx].type) == DT_ADDR)
- rfc822_free_address ((ADDRESS **) MuttVars[idx].data);
- else
- mem_free ((void *) MuttVars[idx].data);
-
- mutt_extract_token (tmp, s, 0);
- if (DTYPE (MuttVars[idx].type) == DT_PATH) {
- strfcpy (scratch, tmp->data, sizeof (scratch));
- mutt_expand_path (scratch, sizeof (scratch));
- *((char **) MuttVars[idx].data) = str_dup (scratch);
- }
- else if (DTYPE (MuttVars[idx].type) == DT_STR) {
- /* see if the value may only be a certain value... */
- if (check_special (MuttVars[idx].option, tmp->data)) {
- *((char **) MuttVars[idx].data) = str_dup (tmp->data);
- if (str_cmp (MuttVars[idx].option, "charset") == 0)
- mutt_set_charset (Charset);
- } else {
- /* ... and abort if it fails */
- snprintf (err->data, err->dsize, "'%s' is invalid for $%s",
- tmp->data, MuttVars[idx].option);
- return (-1);
- }
- }
- else {
- *((ADDRESS **) MuttVars[idx].data) =
- rfc822_parse_adrlist (NULL, tmp->data);
- }
- }