Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-client/mutt/files: mutt-1.5.20-ungroup-command-77ac8b5c2be6.patch mutt-1.5.20-propagate-mh_read_sequences-2fc9348684fe.patch mutt-1.5.20-hcache-uidvalidity-size-fix.patch
Date: Wed, 29 Jul 2009 19:55:44
Message-Id: E1MWFFW-0004YR-EL@stork.gentoo.org
1 grobian 09/07/29 19:55:42
2
3 Added: mutt-1.5.20-ungroup-command-77ac8b5c2be6.patch
4 mutt-1.5.20-propagate-mh_read_sequences-2fc9348684fe.patch
5 mutt-1.5.20-hcache-uidvalidity-size-fix.patch
6 Log:
7 Bump to -r4 having the latest patches plus sparc64 hcache fix. Possible fix for bug #278332, introduction of USE=doc, so we don't have to build documentation all the time (it's on the web anyway)
8 (Portage version: 2.2.00.13849-prefix/cvs/Darwin powerpc)
9
10 Revision Changes Path
11 1.1 mail-client/mutt/files/mutt-1.5.20-ungroup-command-77ac8b5c2be6.patch
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-client/mutt/files/mutt-1.5.20-ungroup-command-77ac8b5c2be6.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-client/mutt/files/mutt-1.5.20-ungroup-command-77ac8b5c2be6.patch?rev=1.1&content-type=text/plain
15
16 Index: mutt-1.5.20-ungroup-command-77ac8b5c2be6.patch
17 ===================================================================
18 http://dev.mutt.org/trac/changeset/77ac8b5c2be6
19 http://dev.mutt.org/trac/ticket/3304
20
21 Implement ungroup command. Closes #3304.
22
23 requires 7c4484ba9e4b (patch added)
24 Move remove_from_rx_list() to muttlib.c, name it mutt_remove_from_rx_list()
25
26
27 Index: group.c
28 ===================================================================
29 --- group.c (revision 5801:19e62bd1549b)
30 +++ group.c (revision 5989:77ac8b5c2be6)
31 @@ -49,6 +50,42 @@
32 hash_insert (Groups, p->name, p, 0);
33 }
34 -
35 +
36 return p;
37 +}
38 +
39 +static void group_free (void *p)
40 +{
41 + group_t *g = (group_t *)p;
42 +
43 + if (!g)
44 + return;
45 + FREE(&g->name);
46 + rfc822_free_address (&g->as);
47 + mutt_free_rx_list (&g->rs);
48 + FREE(&g);
49 +}
50 +
51 +int mutt_group_remove (group_t * g, BUFFER * err)
52 +{
53 + int h;
54 +
55 + if (!g)
56 + return -1;
57 + h = Groups->hash_string ((const unsigned char *)g->name, Groups->nelem);
58 + if (!hash_find_hash (Groups, h, g->name))
59 + {
60 + if (err)
61 + snprintf (err->data, err->dsize, _("No such group: %s"), g->name);
62 + return -1;
63 + }
64 + hash_delete_hash (Groups, h, g->name, g, group_free);
65 + return 0;
66 +}
67 +
68 +static int empty_group (group_t *g)
69 +{
70 + if (!g)
71 + return -1;
72 + return !g->as && !g->rs;
73 }
74
75 @@ -92,7 +129,27 @@
76 }
77
78 +static int mutt_group_remove_adrlist (group_t *g, ADDRESS *a)
79 +{
80 + ADDRESS *p;
81 +
82 + if (!g)
83 + return -1;
84 + if (!a)
85 + return -1;
86 +
87 + for (p = a; p; p = p->next)
88 + rfc822_remove_from_adrlist (&g->as, p->mailbox);
89 +
90 + return 0;
91 +}
92 +
93 static int mutt_group_add_rx (group_t *g, const char *s, int flags, BUFFER *err)
94 {
95 return mutt_add_to_rx_list (&g->rs, s, flags, err);
96 +}
97 +
98 +static int mutt_group_remove_rx (group_t *g, const char *s)
99 +{
100 + return mutt_remove_from_rx_list (&g->rs, s);
101 }
102
103 @@ -103,8 +160,22 @@
104 }
105
106 +int mutt_group_context_remove_adrlist (group_context_t *ctx, ADDRESS * a)
107 +{
108 + int rv = 0;
109 +
110 + for (; (!rv) && ctx; ctx = ctx->next)
111 + {
112 + rv = mutt_group_remove_adrlist (ctx->g, a);
113 + if (empty_group (ctx->g))
114 + mutt_group_remove (ctx->g, NULL);
115 + }
116 +
117 + return rv;
118 +}
119 +
120 int mutt_group_context_add_rx (group_context_t *ctx, const char *s, int flags, BUFFER *err)
121 {
122 int rv = 0;
123 -
124 +
125 for (; (!rv) && ctx; ctx = ctx->next)
126 rv = mutt_group_add_rx (ctx->g, s, flags, err);
127 @@ -113,8 +184,22 @@
128 }
129
130 +int mutt_group_context_remove_rx (group_context_t *ctx, const char *s)
131 +{
132 + int rv = 0;
133 +
134 + for (; (!rv) && ctx; ctx = ctx->next)
135 + {
136 + rv = mutt_group_remove_rx (ctx->g, s);
137 + if (empty_group (ctx->g))
138 + mutt_group_remove (ctx->g, NULL);
139 + }
140 +
141 + return rv;
142 +}
143 +
144 int mutt_group_match (group_t *g, const char *s)
145 {
146 ADDRESS *ap;
147 -
148 +
149 if (s && g)
150 {
151 Index: group.h
152 ===================================================================
153 --- group.h (revision 5989:77ac8b5c2be6)
154 +++ group.h (revision 5989:77ac8b5c2be6)
155 @@ -0,0 +1,39 @@
156 +/*
157 + * Copyright (C) 2006 Thomas Roessler <roessler@××××××××××××××.org>
158 + * Copyright (C) 2009 Rocco Rutte <pdmef@×××.net>
159 + *
160 + * This program is free software; you can redistribute it and/or modify
161 + * it under the terms of the GNU General Public License as published by
162 + * the Free Software Foundation; either version 2 of the License, or
163 + * (at your option) any later version.
164 + *
165 + * This program is distributed in the hope that it will be useful,
166 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
167 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
168 + * GNU General Public License for more details.
169 + *
170 + * You should have received a copy of the GNU General Public License
171 + * along with this program; if not, write to the Free Software
172 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
173 + */
174 +
175 +#ifndef _MUTT_GROUP_H_
176 +#define _MUTT_GROUP_H_ 1
177 +
178 +#define M_GROUP 0
179 +#define M_UNGROUP 1
180 +
181 +void mutt_group_add_adrlist (group_t *g, ADDRESS *a);
182 +
183 +void mutt_group_context_add (group_context_t **ctx, group_t *group);
184 +void mutt_group_context_destroy (group_context_t **ctx);
185 +void mutt_group_context_add_adrlist (group_context_t *ctx, ADDRESS *a);
186 +int mutt_group_context_add_rx (group_context_t *ctx, const char *s, int flags, BUFFER *err);
187 +
188 +int mutt_group_match (group_t *g, const char *s);
189 +
190 +int mutt_group_remove (group_t *, BUFFER *);
191 +int mutt_group_context_remove_rx (group_context_t *ctx, const char *s);
192 +int mutt_group_context_remove_adrlist (group_context_t *ctx, ADDRESS *);
193 +
194 +#endif /* _MUTT_GROUP_H_ */
195 Index: init.c
196 ===================================================================
197 --- init.c (revision 5988:7c4484ba9e4b)
198 +++ init.c (revision 5989:77ac8b5c2be6)
199 @@ -32,4 +32,5 @@
200 #include "mutt_crypt.h"
201 #include "mutt_idna.h"
202 +#include "group.h"
203
204 #if defined(USE_SSL)
205 @@ -834,38 +835,53 @@
206 ADDRESS *addr = NULL;
207 char *estr = NULL;
208 -
209 - do
210 +
211 + do
212 {
213 mutt_extract_token (buf, s, 0);
214 if (parse_group_context (&gc, buf, s, data, err) == -1)
215 goto bail;
216 -
217 +
218 + if (data == M_UNGROUP && !mutt_strcasecmp (buf->data, "*"))
219 + {
220 + if (mutt_group_remove (gc->g, err) < 0)
221 + goto bail;
222 + goto out;
223 + }
224 +
225 if (!mutt_strcasecmp (buf->data, "-rx"))
226 state = RX;
227 else if (!mutt_strcasecmp (buf->data, "-addr"))
228 state = ADDR;
229 - else
230 - {
231 - switch (state)
232 + else
233 + {
234 + switch (state)
235 {
236 case NONE:
237 - strfcpy (err->data, _("Missing -rx or -addr."), err->dsize);
238 + snprintf (err->data, err->dsize, _("%sgroup: missing -rx or -addr."),
239 + data == M_UNGROUP ? "un" : "");
240 goto bail;
241 -
242 +
243 case RX:
244 - if (mutt_group_context_add_rx (gc, buf->data, REG_ICASE, err) != 0)
245 + if (data == M_GROUP &&
246 + mutt_group_context_add_rx (gc, buf->data, REG_ICASE, err) != 0)
247 + goto bail;
248 + else if (data == M_UNGROUP &&
249 + mutt_group_context_remove_rx (gc, buf->data) < 0)
250 goto bail;
251 break;
252 -
253 +
254 case ADDR:
255 if ((addr = mutt_parse_adrlist (NULL, buf->data)) == NULL)
256 goto bail;
257 - if (mutt_addrlist_to_idna (addr, &estr))
258 - {
259 - snprintf (err->data, err->dsize, _("Warning: Bad IDN '%s'.\n"),
260 - estr);
261 + if (mutt_addrlist_to_idna (addr, &estr))
262 + {
263 + snprintf (err->data, err->dsize, _("%sgroup: warning: bad IDN '%s'.\n"),
264 + data == 1 ? "un" : "", estr);
265 goto bail;
266 }
267 - mutt_group_context_add_adrlist (gc, addr);
268 + if (data == M_GROUP)
269 + mutt_group_context_add_adrlist (gc, addr);
270 + else if (data == M_UNGROUP)
271 + mutt_group_context_remove_adrlist (gc, addr);
272 rfc822_free_address (&addr);
273 break;
274 @@ -874,15 +890,10 @@
275 } while (MoreArgs (s));
276
277 +out:
278 mutt_group_context_destroy (&gc);
279 return 0;
280
281 - bail:
282 +bail:
283 mutt_group_context_destroy (&gc);
284 - return -1;
285 -}
286 -
287 -static int parse_ungroup (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
288 -{
289 - strfcpy (err->data, "not implemented", err->dsize);
290 return -1;
291 }
292 Index: init.h
293 ===================================================================
294 --- init.h (revision 5976:376545d6909c)
295 +++ init.h (revision 5989:77ac8b5c2be6)
296 @@ -3420,5 +3420,4 @@
297
298 static int parse_group (BUFFER *, BUFFER *, unsigned long, BUFFER *);
299 -static int parse_ungroup (BUFFER *, BUFFER *, unsigned long, BUFFER *);
300
301 static int parse_lists (BUFFER *, BUFFER *, unsigned long, BUFFER *);
302 @@ -3473,6 +3472,6 @@
303 { "fcc-save-hook", mutt_parse_hook, M_FCCHOOK | M_SAVEHOOK },
304 { "folder-hook", mutt_parse_hook, M_FOLDERHOOK },
305 - { "group", parse_group, 0 },
306 - { "ungroup", parse_ungroup, 0 },
307 + { "group", parse_group, M_GROUP },
308 + { "ungroup", parse_group, M_UNGROUP },
309 { "hdr_order", parse_list, UL &HeaderOrderList },
310 #ifdef HAVE_ICONV
311 Index: pattern.c
312 ===================================================================
313 --- pattern.c (revision 5930:ed7eb5de7536)
314 +++ pattern.c (revision 5989:77ac8b5c2be6)
315 @@ -36,4 +36,5 @@
316 #include "mutt_crypt.h"
317 #include "mutt_curses.h"
318 +#include "group.h"
319
320 #ifdef USE_IMAP
321 Index: protos.h
322 ===================================================================
323 --- protos.h (revision 5977:f161c2f00d84)
324 +++ protos.h (revision 5989:77ac8b5c2be6)
325 @@ -76,9 +76,4 @@
326 void mutt_parse_content_type (char *, BODY *);
327 void mutt_generate_boundary (PARAMETER **);
328 -void mutt_group_add_adrlist (group_t *, ADDRESS *);
329 -void mutt_group_context_add (group_context_t **ctx, group_t *group);
330 -void mutt_group_context_destroy (group_context_t **ctx);
331 -void mutt_group_add_adrlist (group_t *g, ADDRESS *a);
332 -void mutt_group_context_add_adrlist (group_context_t *ctx, ADDRESS *a);
333 void mutt_delete_parameter (const char *attribute, PARAMETER **p);
334 void mutt_set_parameter (const char *, const char *, PARAMETER **);
335 @@ -312,6 +307,4 @@
336 int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, size_t);
337 int mutt_get_tmp_attachment (BODY *);
338 -int mutt_group_match (group_t *g, const char *s);
339 -int mutt_group_context_add_rx (group_context_t *ctx, const char *s, int flags, BUFFER *err);
340 int mutt_index_menu (void);
341 int mutt_invoke_sendmail (ADDRESS *, ADDRESS *, ADDRESS *, ADDRESS *, const char *, int);
342 Index: rfc822.c
343 ===================================================================
344 --- rfc822.c (revision 5923:ee3d174297bb)
345 +++ rfc822.c (revision 5989:77ac8b5c2be6)
346 @@ -81,4 +81,43 @@
347 }
348 *w = 0;
349 +}
350 +
351 +static void free_address (ADDRESS *a)
352 +{
353 + FREE(&a->personal);
354 + FREE(&a->mailbox);
355 +#ifdef EXACT_ADDRESS
356 + FREE(&a->val);
357 +#endif
358 +}
359 +
360 +int rfc822_remove_from_adrlist (ADDRESS **a, const char *mailbox)
361 +{
362 + ADDRESS *p, *last = NULL, *t;
363 + int rv = -1;
364 +
365 + p = *a;
366 + last = NULL;
367 + while (p)
368 + {
369 + if (ascii_strcasecmp (mailbox, p->mailbox) == 0)
370 + {
371 + if (last)
372 + last->next = p->next;
373 + else
374 + (*a) = p->next;
375 + t = p;
376 + p = p->next;
377 + free_address (t);
378 + rv = 0;
379 + }
380 + else
381 + {
382 + last = p;
383 + p = p->next;
384 + }
385 + }
386 +
387 + return (rv);
388 }
389
390 Index: rfc822.h
391 ===================================================================
392 --- rfc822.h (revision 5986:848f08512bf3)
393 +++ rfc822.h (revision 5989:77ac8b5c2be6)
394 @@ -58,4 +58,5 @@
395 void rfc822_cat (char *, size_t, const char *, const char *);
396 int rfc822_valid_msgid (const char *msgid);
397 +int rfc822_remove_from_adrlist (ADDRESS **a, const char *mailbox);
398
399 extern int RFC822Error;
400
401
402
403 Index: init.c
404 ===================================================================
405 --- init.c (revision 5903:b5ed5d96c775)
406 +++ init.c (revision 5988:7c4484ba9e4b)
407 @@ -600,40 +600,4 @@
408 }
409
410 -static int remove_from_rx_list (RX_LIST **l, const char *str)
411 -{
412 - RX_LIST *p, *last = NULL;
413 - int rv = -1;
414 -
415 - if (mutt_strcmp ("*", str) == 0)
416 - {
417 - mutt_free_rx_list (l); /* ``unCMD *'' means delete all current entries */
418 - rv = 0;
419 - }
420 - else
421 - {
422 - p = *l;
423 - last = NULL;
424 - while (p)
425 - {
426 - if (ascii_strcasecmp (str, p->rx->pattern) == 0)
427 - {
428 - mutt_free_regexp (&p->rx);
429 - if (last)
430 - last->next = p->next;
431 - else
432 - (*l) = p->next;
433 - FREE (&p);
434 - rv = 0;
435 - }
436 - else
437 - {
438 - last = p;
439 - p = p->next;
440 - }
441 - }
442 - }
443 - return (rv);
444 -}
445 -
446 static int parse_unignore (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
447 {
448 @@ -701,5 +665,5 @@
449 goto bail;
450
451 - remove_from_rx_list (&UnAlternates, buf->data);
452 + mutt_remove_from_rx_list (&UnAlternates, buf->data);
453
454 if (mutt_add_to_rx_list (&Alternates, buf->data, REG_ICASE, err) != 0)
455 @@ -725,5 +689,5 @@
456 {
457 mutt_extract_token (buf, s, 0);
458 - remove_from_rx_list (&Alternates, buf->data);
459 + mutt_remove_from_rx_list (&Alternates, buf->data);
460
461 if (mutt_strcmp (buf->data, "*") &&
462 @@ -775,5 +739,5 @@
463 else
464 {
465 - remove_from_rx_list(&NoSpamList, buf->data);
466 + mutt_remove_from_rx_list(&NoSpamList, buf->data);
467 }
468
469 @@ -842,5 +806,5 @@
470 goto bail;
471
472 - remove_from_rx_list (&UnMailLists, buf->data);
473 + mutt_remove_from_rx_list (&UnMailLists, buf->data);
474
475 if (mutt_add_to_rx_list (&MailLists, buf->data, REG_ICASE, err) != 0)
476 @@ -1194,6 +1158,6 @@
477 {
478 mutt_extract_token (buf, s, 0);
479 - remove_from_rx_list (&SubscribedLists, buf->data);
480 - remove_from_rx_list (&MailLists, buf->data);
481 + mutt_remove_from_rx_list (&SubscribedLists, buf->data);
482 + mutt_remove_from_rx_list (&MailLists, buf->data);
483
484 if (mutt_strcmp (buf->data, "*") &&
485 @@ -1217,6 +1181,6 @@
486 goto bail;
487
488 - remove_from_rx_list (&UnMailLists, buf->data);
489 - remove_from_rx_list (&UnSubscribedLists, buf->data);
490 + mutt_remove_from_rx_list (&UnMailLists, buf->data);
491 + mutt_remove_from_rx_list (&UnSubscribedLists, buf->data);
492
493 if (mutt_add_to_rx_list (&MailLists, buf->data, REG_ICASE, err) != 0)
494 @@ -1242,5 +1206,5 @@
495 {
496 mutt_extract_token (buf, s, 0);
497 - remove_from_rx_list (&SubscribedLists, buf->data);
498 + mutt_remove_from_rx_list (&SubscribedLists, buf->data);
499
500 if (mutt_strcmp (buf->data, "*") &&
501 Index: mutt.h
502 ===================================================================
503 --- mutt.h (revision 5956:ef6523d11f24)
504 +++ mutt.h (revision 5988:7c4484ba9e4b)
505 @@ -555,4 +555,5 @@
506 LIST *mutt_add_list_n (LIST*, const void *, size_t);
507 LIST *mutt_find_list (LIST *, const char *);
508 +int mutt_remove_from_rx_list (RX_LIST **l, const char *str);
509
510 void mutt_init (int, LIST *);
511 Index: muttlib.c
512 ===================================================================
513 --- muttlib.c (revision 5977:f161c2f00d84)
514 +++ muttlib.c (revision 5988:7c4484ba9e4b)
515 @@ -266,4 +266,40 @@
516 }
517 return NULL;
518 +}
519 +
520 +int mutt_remove_from_rx_list (RX_LIST **l, const char *str)
521 +{
522 + RX_LIST *p, *last = NULL;
523 + int rv = -1;
524 +
525 + if (mutt_strcmp ("*", str) == 0)
526 + {
527 + mutt_free_rx_list (l); /* ``unCMD *'' means delete all current entries */
528 + rv = 0;
529 + }
530 + else
531 + {
532 + p = *l;
533 + last = NULL;
534 + while (p)
535 + {
536 + if (ascii_strcasecmp (str, p->rx->pattern) == 0)
537 + {
538 + mutt_free_regexp (&p->rx);
539 + if (last)
540 + last->next = p->next;
541 + else
542 + (*l) = p->next;
543 + FREE (&p);
544 + rv = 0;
545 + }
546 + else
547 + {
548 + last = p;
549 + p = p->next;
550 + }
551 + }
552 + }
553 + return (rv);
554 }
555
556
557
558
559 1.1 mail-client/mutt/files/mutt-1.5.20-propagate-mh_read_sequences-2fc9348684fe.patch
560
561 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-client/mutt/files/mutt-1.5.20-propagate-mh_read_sequences-2fc9348684fe.patch?rev=1.1&view=markup
562 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-client/mutt/files/mutt-1.5.20-propagate-mh_read_sequences-2fc9348684fe.patch?rev=1.1&content-type=text/plain
563
564 Index: mutt-1.5.20-propagate-mh_read_sequences-2fc9348684fe.patch
565 ===================================================================
566 http://dev.mutt.org/trac/changeset/2fc9348684fe
567 http://dev.mutt.org/trac/ticket/3308
568
569 Properly propagate mh_read_sequences result. Closes #3308.
570
571
572 Index: mh.c
573 ===================================================================
574 --- mh.c (revision 5985:9f3053f75f27)
575 +++ mh.c (revision 5999:2fc9348684fe)
576 @@ -168,5 +168,5 @@
577
578 short f;
579 - int first, last, rc;
580 + int first, last, rc = 0;
581
582 char pathname[_POSIX_PATH_MAX];
583 @@ -208,5 +208,5 @@
584 FREE (&buff);
585 safe_fclose (&fp);
586 - return 0;
587 + return rc;
588 }
589
590 @@ -1157,5 +1157,5 @@
591 if (ctx->magic == M_MH)
592 {
593 - if (mh_read_sequences (&mhs, ctx->path) >= 0)
594 + if (mh_read_sequences (&mhs, ctx->path) < 0)
595 return -1;
596 mh_update_maildir (md, &mhs);
597
598
599
600 1.1 mail-client/mutt/files/mutt-1.5.20-hcache-uidvalidity-size-fix.patch
601
602 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-client/mutt/files/mutt-1.5.20-hcache-uidvalidity-size-fix.patch?rev=1.1&view=markup
603 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-client/mutt/files/mutt-1.5.20-hcache-uidvalidity-size-fix.patch?rev=1.1&content-type=text/plain
604
605 Index: mutt-1.5.20-hcache-uidvalidity-size-fix.patch
606 ===================================================================
607 http://dev.mutt.org/trac/attachment/ticket/3296/hcache-uidvalidity-size-fix.patch
608
609 diff --git a/hcache.c b/hcache.c
610 --- a/hcache.c
611 +++ b/hcache.c
612 @@ -86,7 +86,7 @@
613 typedef union
614 {
615 struct timeval timeval;
616 - unsigned long uid_validity;
617 + unsigned int uidvalidity;
618 } validate;
619
620 static void *
621 @@ -589,7 +589,7 @@
622 * db_store */
623 static void *
624 mutt_hcache_dump(header_cache_t *h, HEADER * header, int *off,
625 - unsigned long uid_validity)
626 + unsigned int uidvalidity)
627 {
628 unsigned char *d = NULL;
629 HEADER nh;
630 @@ -598,8 +598,8 @@
631 *off = 0;
632 d = lazy_malloc(sizeof (validate));
633
634 - if (uid_validity)
635 - memcpy(d, &uid_validity, sizeof (unsigned long));
636 + if (uidvalidity)
637 + memcpy(d, &uidvalidity, sizeof (uidvalidity));
638 else
639 {
640 struct timeval now;
641 @@ -758,7 +758,7 @@
642
643 int
644 mutt_hcache_store(header_cache_t *h, const char *filename, HEADER * header,
645 - unsigned long uid_validity,
646 + unsigned int uidvalidity,
647 size_t(*keylen) (const char *fn))
648 {
649 char* data;
650 @@ -768,7 +768,7 @@
651 if (!h)
652 return -1;
653
654 - data = mutt_hcache_dump(h, header, &dlen, uid_validity);
655 + data = mutt_hcache_dump(h, header, &dlen, uidvalidity);
656 ret = mutt_hcache_store_raw (h, filename, data, dlen, keylen);
657
658 FREE(&data);
659 diff --git a/hcache.h b/hcache.h
660 --- a/hcache.h
661 +++ b/hcache.h
662 @@ -33,8 +33,9 @@
663 void *mutt_hcache_fetch(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn));
664 void *mutt_hcache_fetch_raw (header_cache_t *h, const char *filename,
665 size_t (*keylen)(const char *fn));
666 +/* uidvalidity is an IMAP-specific unsigned 32 bit number */
667 int mutt_hcache_store(header_cache_t *h, const char *filename, HEADER *header,
668 - unsigned long uid_validity, size_t (*keylen)(const char *fn));
669 + unsigned int uidvalidity, size_t (*keylen)(const char *fn));
670 int mutt_hcache_store_raw (header_cache_t *h, const char* filename, void* data,
671 size_t dlen, size_t(*keylen) (const char* fn));
672 int mutt_hcache_delete(header_cache_t *h, const char *filename, size_t (*keylen)(const char *fn));
673 diff --git a/imap/util.c b/imap/util.c
674 --- a/imap/util.c
675 +++ b/imap/util.c
676 @@ -129,6 +129,8 @@
677 {
678 if (*uv == idata->uid_validity)
679 h = mutt_hcache_restore ((unsigned char*)uv, NULL);
680 + else
681 + dprint (3, (debugfile, "hcache uidvalidity mismatch: %u", *uv));
682 FREE (&uv);
683 }