- 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);
- }
- }
- }
- else if (DTYPE (MuttVars[idx].type) == DT_RX) {
- rx_t *ptr = (rx_t *) MuttVars[idx].data;
- regex_t *rx;
- int e, flags = 0;
-
- if (query || *s->dptr != '=') {
- rx_to_string (err->data, err->dsize, idx);
- break;
- }
-
- if (option (OPTATTACHMSG)
- && !str_cmp (MuttVars[idx].option, "reply_regexp")) {
- snprintf (err->data, err->dsize,
- "Operation not permitted when in attach-message mode.");
- r = -1;
- break;
- }
-
- s->dptr++;
-
- /* copy the value of the string */
- mutt_extract_token (tmp, s, 0);
-
- if (!ptr->pattern || str_cmp (ptr->pattern, tmp->data) != 0) {
- int not = 0;
-
- /* $mask is case-sensitive */
- if (str_cmp (MuttVars[idx].option, "mask") != 0)
- flags |= mutt_which_case (tmp->data);
-
- p = tmp->data;
- if (str_cmp (MuttVars[idx].option, "mask") == 0) {
- if (*p == '!') {
- not = 1;
- p++;
- }
- }
-
- rx = (regex_t *) mem_malloc (sizeof (regex_t));
- if ((e = REGCOMP (rx, p, flags)) != 0) {
- regerror (e, rx, err->data, err->dsize);
- regfree (rx);
- mem_free (&rx);
+ else if (DTYPE (option->type) == DT_STR ||
+ DTYPE (option->type) == DT_PATH ||
+ DTYPE (option->type) == DT_ADDR ||
+ DTYPE (option->type) == DT_MAGIC ||
+ DTYPE (option->type) == DT_NUM ||
+ DTYPE (option->type) == DT_SORT ||
+ DTYPE (option->type) == DT_RX ||
+ DTYPE (option->type) == DT_USER) {
+
+ /* XXX maybe we need to get unset into handlers? */
+ if (DTYPE (option->type) == DT_STR ||
+ DTYPE (option->type) == DT_PATH ||
+ DTYPE (option->type) == DT_ADDR ||
+ DTYPE (option->type) == DT_USER) {
+ if (unset) {
+ if (DTYPE (option->type) == DT_ADDR)
+ rfc822_free_address ((ADDRESS **) option->data);
+ else if (DTYPE (option->type) == DT_USER)
+ /* to unset $user_ means remove */
+ hash_delete (ConfigOptions, option->option,
+ option, del_user_option);
+ else
+ mem_free ((void *) option->data);