- 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 != '=') {
- /* user requested the value of this variable */
- snprintf (err->data, err->dsize, "%s=\"%s\"", MuttVars[idx].option,
- NONULL (ptr->pattern));
- 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);
- break;
- }
-
- /* get here only if everything went smootly */
- if (ptr->pattern) {
- mem_free (&ptr->pattern);
- regfree ((regex_t *) ptr->rx);
- mem_free (&ptr->rx);
- }
-
- ptr->pattern = str_dup (tmp->data);
- ptr->rx = rx;
- ptr->not = not;
-
- /* $reply_regexp and $alterantes require special treatment */
-
- if (Context && Context->msgcount &&
- str_cmp (MuttVars[idx].option, "reply_regexp") == 0) {
- regmatch_t pmatch[1];
- int i;
-
-#define CUR_ENV Context->hdrs[i]->env
- for (i = 0; i < Context->msgcount; i++) {
- if (CUR_ENV && CUR_ENV->subject) {
- CUR_ENV->real_subj = (regexec (ReplyRegexp.rx,
- CUR_ENV->subject, 1, pmatch,
- 0)) ? CUR_ENV->
- subject : CUR_ENV->subject + pmatch[0].rm_eo;
- }
- }
-#undef CUR_ENV
- }
- }
- }
- else if (DTYPE (MuttVars[idx].type) == DT_MAGIC) {
- if (query || *s->dptr != '=') {
- switch (DefaultMagic) {
- case M_MBOX:
- p = "mbox";
- break;
- case M_MMDF:
- p = "MMDF";
- break;
- case M_MH:
- p = "MH";
- break;
- case M_MAILDIR:
- p = "Maildir";
- break;
- default:
- p = "unknown";
+ else if (DTYPE (option->type) == DT_STR ||
+ DTYPE (option->type) == DT_PATH ||
+ DTYPE (option->type) == DT_MAGIC ||
+ DTYPE (option->type) == DT_NUM ||
+ DTYPE (option->type) == DT_SORT ||
+ DTYPE (option->type) == DT_RX)
+ {
+ /* XXX maybe we need to get unset into handlers? */
+ if (DTYPE (option->type) == DT_STR || DTYPE (option->type) == DT_PATH) {
+ if (unset) {
+ CHECK_PAGER;
+ p_delete((void **)(void *)&option->data);