1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-01 01:17:02 +00:00
freebsd-ports/mail/mutt/files/patch-date-conditional
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

148 lines
2.8 KiB
Plaintext

--- PATCHES~ never
+++ PATCHES Thu Jun 13 16:25:05 CDT 2002
@@ -0,0 +1 @@
+dgc.deepif.1
diff -Pur mutt-1.5.1-base/muttlib.c mutt-1.5.1/muttlib.c
--- muttlib.c Tue Mar 26 16:47:06 2002
+++ muttlib.c Thu Jun 13 15:28:20 2002
@@ -978,6 +978,12 @@
count = 0;
while (count < sizeof (ifstring) && *src && *src != '?' && *src != '&')
{
+ if (*src == '\\')
+ {
+ src++;
+ if (!*src)
+ break;
+ }
*cp++ = *src++;
count++;
}
@@ -990,7 +996,13 @@
count = 0;
while (count < sizeof (elsestring) && *src && *src != '?')
{
- *cp++ = *src++;
+ if (*src == '\\')
+ {
+ src++;
+ if (!*src)
+ break;
+ }
+ *cp++ = *src++;
count++;
}
*cp = 0;
Index: PATCHES
===================================================================
--- PATCHES (revision 22)
+++ PATCHES (revision 22)
@@ -0,0 +1 @@
+patch-1.5.0.ats.date_conditional.1
Index: muttlib.c
===================================================================
--- muttlib.c (revision 22)
+++ muttlib.c (revision 22)
@@ -944,7 +944,16 @@
if (*src == '?')
{
flags |= M_FORMAT_OPTIONAL;
- src++;
+ ch = *(++src); /* save the character to switch on */
+ cp = prefix;
+ ++src;
+ count = 0;
+ while (count < sizeof (prefix) && *src != '?')
+ {
+ *cp++ = *src++;
+ count++;
+ }
+ *cp = 0;
}
else
{
@@ -960,12 +969,12 @@
count++;
}
*cp = 0;
- }
- if (!*src)
- break; /* bad format */
+ if (!*src)
+ break; /* bad format */
- ch = *src++; /* save the character to switch on */
+ ch = *src++; /* save the character to switch on */
+ }
if (flags & M_FORMAT_OPTIONAL)
{
--- hdrline.c.orig Tue Jun 29 15:01:28 2004
+++ hdrline.c Tue Jun 29 15:02:59 2004
@@ -316,6 +316,64 @@
const char *cp;
struct tm *tm;
time_t T;
+ int i = 0, invert = 0;
+
+ if (optional && (op == '[' || op == '(')) {
+ char *is;
+ int d;
+ T = time(NULL);
+ tm = localtime(&T);
+ d = (T + tm->tm_gmtoff) % 86400;
+ T -= (op == '(') ? hdr->received : hdr->date_sent;
+
+ is = (char *)prefix;
+ if( *is == '>' ) {
+ invert = 1;
+ ++is;
+ }
+
+ while( *is && *is != '?' ) {
+ int t = strtol (is, &is, 10);
+ switch (*(is++)) {
+ case '?':
+ break;
+ case 'y':
+ t *= 365 * 24 * 60 * 60;
+ break;
+ case 'M':
+ t *= 30 * 24 * 60 * 60;
+ break;
+ case 'w':
+ t *= 7 * 24 * 60 * 60;
+ break;
+ case 'd':
+ t *= 24 * 60 * 60;
+ break;
+ case 't':
+ if (t > 1) {
+ t = (t-1) * 24 * 60 * 60;
+ } else {
+ t = 0;
+ }
+ t += d;
+ break;
+ case 'h':
+ t *= 60 * 60;
+ break;
+ case 'm':
+ t *= 60;
+ break;
+ }
+ i += t;
+ }
+
+ if (i < 0)
+ i *= -1;
+
+ if( (T > i || T < -1*i) ^ invert )
+ optional = 0;
+ break;
+ }
p = dest;