<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] For 1.5.12: attachment counting for index display



* Tue Oct  4 2005 TAKAHASHI Tamotsu <ttakah@xxxxxxxxxxxxxxxxx>
> BTW, it changed BODY structure.
> Header cache works fine with no code changes,
> but I'm afraid the old DB does no longer work.
> Maybe hcache.c needs update (only for $Id for CRC).

And someone may want to confirm that
attachments/unattachments settings have not been modified.
You can do it with computing the CRC of these values.

The attached patch below is not tested.
It is attached only to let TG know what I mean.

-- 
tamo
Index: hcache.c
===================================================================
RCS file: /home/roessler/cvs/mutt/hcache.c,v
retrieving revision 3.11
diff -p -u -r3.11 hcache.c
--- hcache.c    22 Sep 2005 16:38:08 -0000      3.11
+++ hcache.c    4 Oct 2005 13:29:12 -0000
@@ -460,6 +460,7 @@ generate_crc32()
   int crc = 0;
   SPAM_LIST *sp = SpamList;
   RX_LIST *rx = NoSpamList;
+  LIST *list = NULL;
 
   crc = crc32(crc, (unsigned char const *) "$Id: hcache.c,v 3.11 2005/09/22 
16:38:08 brendan Exp $", mutt_strlen("$Id: hcache.c,v 3.11 2005/09/22 16:38:08 
brendan Exp $"));
 
@@ -505,6 +506,22 @@ generate_crc32()
     rx = rx->next;
   }
 
+#define CRC_LIST(a) \
+  list = a;\
+  while (list)\
+  {\
+    crc = crc32(crc, (unsigned char const *) list->data,\
+         mutt_strlen(list->data));\
+    list = list->next;\
+  }
+
+  CRC_LIST(AttachAllow)
+  CRC_LIST(AttachExclude)
+  CRC_LIST(InlineAllow)
+  CRC_LIST(InlineExclude)
+
+#undef CRC_LIST
+
   return crc;
 }