freebsd-ports/mail/mutt/files/extra-patch-ifdef
Chris Rees bb040dde3e Move mail/mutt to mail/mutt14
Move mail/mutt-lite to mail/mutt14-lite

Move mail/mutt-devel to mail/mutt

Moving mail/mutt-devel-lite to mail/mutt-lite will follow next to avoid
breaking the cvs exporter

PR:		ports/169546
Suggested by:	obrien
Approved by:	maintainer
2012-07-22 09:15:04 +00:00

79 lines
2.5 KiB
Text

--- mutt-1.5.4.orig/init.c 2003-03-04 08:49:48.000000000 +0100
+++ mutt-1.5.4/init.c 2003-07-22 20:14:47.000000000 +0200
@@ -349,6 +349,52 @@ static void remove_from_list (LIST **l,
}
}
+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, mutt_strlen (tmp->data))
+ && (mutt_strlen (b[j].name) == mutt_strlen (tmp->data)))
+ {
+ res = 1;
+ break;
+ }
+ }
+
+ if (!MoreArgs (s))
+ {
+ snprintf (err->data, err->dsize, _("ifdef: too few arguments"));
+ return (-1);
+ }
+ mutt_extract_token (tmp, s, M_TOKEN_SPACE);
+
+ if (res)
+ {
+ if (mutt_parse_rc_line (tmp->data, &token, err) == -1)
+ {
+ mutt_error ("Erreur: %s", err->data);
+ FREE (&token.data);
+ return (-1);
+ }
+ FREE (&token.data);
+ }
+ return 0;
+}
+
static int parse_unignore (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
{
do
diff -pruN mutt-1.5.4.orig/init.h mutt-1.5.4/init.h
--- mutt-1.5.4.orig/init.h.orig 2009-06-22 15:48:16.000000000 +0200
+++ mutt-1.5.4/init.h 2009-06-22 15:49:28.000000000 +0200
@@ -3658,6 +3658,7 @@
static int parse_unlists (BUFFER *, BUFFER *, unsigned long, BUFFER *);
static int parse_alias (BUFFER *, BUFFER *, unsigned long, BUFFER *);
static int parse_unalias (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+static int parse_ifdef (BUFFER *, BUFFER *, unsigned long, BUFFER *);
static int parse_ignore (BUFFER *, BUFFER *, unsigned long, BUFFER *);
static int parse_unignore (BUFFER *, BUFFER *, unsigned long, BUFFER *);
static int parse_source (BUFFER *, BUFFER *, unsigned long, BUFFER *);
@@ -3715,6 +3716,7 @@
{ "hdr_order", parse_list, UL &HeaderOrderList },
#ifdef HAVE_ICONV
{ "iconv-hook", mutt_parse_hook, M_ICONVHOOK },
+ { "ifdef", parse_ifdef, 0 },
#endif
{ "ignore", parse_ignore, 0 },
{ "lists", parse_lists, 0 },
diff -pruN mutt-1.5.4.orig/PATCHES mutt-1.5.4/PATCHES
--- mutt-1.5.4.orig/PATCHES 2003-03-19 22:33:37.000000000 +0100
+++ mutt-1.5.4/PATCHES 2003-07-22 20:14:47.000000000 +0200
@@ -0,0 +1 @@
+patch-1.5.4.cd.ifdef.1