- }
-}
-
-static int remove_from_rx_list (list2_t** l, const char *str)
-{
- int i = 0;
-
- if (str_cmp ("*", str) == 0) {
- list_del (l, (list_del_t*) rx_free);
- return (0);
- }
- else {
- i = rx_lookup ((*l), str);
- if (i >= 0) {
- rx_t* r = list_pop_idx ((*l), i);
- rx_free (&r);
- return (0);
- }
- }
- return (-1);
-}
-
-static int parse_ifdef (BUFFER * tmp, BUFFER * s, unsigned long data,
- BUFFER * err)
-{
- int i, j, res = 0;
- BUFFER token;
-
- memset (&token, 0, sizeof (token));
- mutt_extract_token (tmp, s, 0);
-
- /* is the item defined as a variable or a function? */
- if (!(res = (mutt_option_index (tmp->data) != -1)))
- for (i = 0; !res && i < MENU_MAX; i++) {
- struct binding_t *b = km_get_table (Menus[i].value);
-
- if (!b)
- continue;
-
- for (j = 0; b[j].name; j++)
- if (!ascii_strncasecmp (tmp->data, b[j].name, str_len (tmp->data))
- && (str_len (b[j].name) == str_len (tmp->data))) {
- res = 1;
- break;
- }
- }
- /* check for feature_* */
- if (!res) {
- char *p = NULL;
-
- i = 0;
- j = str_len (tmp->data);
- /* need at least input of 'feature_X' */
- if (j >= 7) {
- p = tmp->data + 7;
- j -= 7;
- while (Features[i].name) {
- if (str_len (Features[i].name) == j &&
- ascii_strncasecmp (Features[i].name, p, j)) {
- res = 1;
- break;
- }
- i++;
- }
- }
- }
-
- if (!MoreArgs (s)) {
- if (data)
- snprintf (err->data, err->dsize, _("ifdef: too few arguments"));
- else
- snprintf (err->data, err->dsize, _("ifndef: too few arguments"));
- return (-1);
- }
- mutt_extract_token (tmp, s, M_TOKEN_SPACE);
-
- if ((data && res) || (!data && !res)) {
- if (mutt_parse_rc_line (tmp->data, &token, err) == -1) {
- mutt_error ("Error: %s", err->data);
- mem_free (&token.data);
- return (-1);
- }
- mem_free (&token.data);
- }
- return 0;
-}
-
-static int parse_unignore (BUFFER * buf, BUFFER * s, unsigned long data,
- BUFFER * err)
-{
- do {
- mutt_extract_token (buf, s, 0);
-
- /* don't add "*" to the unignore list */
- if (strcmp (buf->data, "*"))
- add_to_list (&UnIgnore, buf->data);
-
- remove_from_list (&Ignore, buf->data);