hi, now that we've rolled over 1000000000 seconds a bug in the pine
maildir module has cropped up.  the patch below fixes it.  i've also got a
full SRPM which should work on redhat 6.x and 7.x (although you'll need to
rebuild it for 7.x).

http://arctic.org/~dean/linux/6.2/pine-4.33-1.62.dg3.src.rpm

i'm not on the qmail list, cc me if you want me to see any reply.

-dean

--- pine4.33/imap/src/osdep/unix/maildir.c.1billion     Wed May  9 11:00:41 2001
+++ pine4.33/imap/src/osdep/unix/maildir.c      Sun Sep  9 11:30:18 2001
@@ -542,7 +542,23 @@

 int maildir_namesort (struct direct **d1,struct direct **d2)
 {
-  return strcmp ((*d1)->d_name,(*d2)->d_name);
+/* this maildir module is kind of lame and expects files it just moved
+ * from new/ to cur/ to show up at the end of the sorting... this mostly
+ * works fine when the timestamp is less than 1000000000 -- you can just
+ * strcmp.  but when the timestamp went past that point we need to do
+ * this convoluted sort.
+ */
+  unsigned long t1, t2;
+
+  t1 = strtoul((*d1)->d_name, NULL, 10);
+  t2 = strtoul((*d2)->d_name, NULL, 10);
+  if (t1 == t2) {
+    return strcmp ((*d1)->d_name,(*d2)->d_name);
+  }
+  else if (t1 > t2) {
+    return 1;
+  }
+  return -1;
 }




Reply via email to