- repair feature_ tests (jnf gung zr? jnf V qehax?)
git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@464
e385b8ad-14ed-0310-8656-
cc95a2468c6d
mutt_extract_token (tmp, s, 0);
/* is the item defined as a variable or a function? */
mutt_extract_token (tmp, s, 0);
/* is the item defined as a variable or a function? */
- if ((option = hash_find (ConfigOptions, tmp->data)))
+ if ((option = hash_find (ConfigOptions, tmp->data)) != NULL)
res = 1;
else {
for (i = 0; !res && i < MENU_MAX; i++) {
res = 1;
else {
for (i = 0; !res && i < MENU_MAX; i++) {
}
}
/* check for feature_* */
}
}
/* check for feature_* */
- if (!res) {
- char *p = NULL;
-
+ if (!res && ascii_strncasecmp (tmp->data, "feature_", 8) == 0 &&
+ (j = str_len (tmp->data)) > 8) {
- 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++;
+ while (Features[i]) {
+ if (str_len (Features[i]) == j-8 &&
+ ascii_strncasecmp (Features[i], tmp->data+8, j-8) == 0) {
+ res = 1;
+ break;
snprintf (err->data, err->dsize, _("ifndef: too few arguments"));
return (-1);
}
snprintf (err->data, err->dsize, _("ifndef: too few arguments"));
return (-1);
}
mutt_extract_token (tmp, s, M_TOKEN_SPACE);
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);
if (mutt_parse_rc_line (tmp->data, &token, err) == -1) {
mutt_error ("Error: %s", err->data);
mem_free (&token.data);
-struct feature_t {
- char *name;
- short builtin;
-};
-
#define UL (unsigned long)
#endif /* _MAKEDOC */
#define UL (unsigned long)
#endif /* _MAKEDOC */
-const struct feature_t Features[] = {
- {"ncurses",
+static const char* Features[] = {
#ifdef CRYPT_BACKEND_CLASSIC_PGP
#ifdef CRYPT_BACKEND_CLASSIC_PGP
#ifdef CRYPT_BACKEND_CLASSIC_SMIME
#ifdef CRYPT_BACKEND_CLASSIC_SMIME
#ifdef CRYPT_BACKEND_GPGME
#ifdef CRYPT_BACKEND_GPGME
};
const struct mapping_t SortMethods[] = {
};
const struct mapping_t SortMethods[] = {