1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
--- PATCHES~ never
+++ PATCHES Thu Jun 13 16:25:05 CDT 2002
@@ -1,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)
@@ -1,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 Thu Jun 24 11:16:36 2004
+++ hdrline.c Thu Jun 24 11:43:28 2004
@@ -316,6 +316,63 @@
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);
+ d = T % 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;
|