summaryrefslogtreecommitdiff
path: root/mail/mutt/files/patch-date-conditional
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mutt/files/patch-date-conditional')
-rw-r--r--mail/mutt/files/patch-date-conditional147
1 files changed, 147 insertions, 0 deletions
diff --git a/mail/mutt/files/patch-date-conditional b/mail/mutt/files/patch-date-conditional
new file mode 100644
index 000000000000..7912815f0bce
--- /dev/null
+++ b/mail/mutt/files/patch-date-conditional
@@ -0,0 +1,147 @@
+--- 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;
+