On Wed, Sep 12, 2001 at 10:23:18PM -0400, tc lewis wrote:
> i'm sure this has already been addressed and patches submitted, but just
> in case, here's a patch to get pine 4.33 to sort maildirs with pre and
> post 1000000000 time messages correctly. it should be applied overtop of
> the pine-maildir-4.33 patch found on qmail.org.
Speaking of which, am I just seeing things, or is there a prototype
mismatch between maildir_append() and the append() function in the mail
DRIVER interface (mail.h)?
Based on what I understand about the interface, the following patch
(applied after pine-maildir-4.33) should fix this. It stopped a whole
bunch of segfaults for me, but if it doesn't work for you (or you
didn't need anything like this), please let me know. Suggestions for
improvements are also welcome.
----- Patch follows -----
*** pine4.33-old/imap/src/osdep/unix/maildir.c Thu Sep 13 11:50:04 2001
--- pine4.33/imap/src/osdep/unix/maildir.c Thu Sep 13 11:54:39 2001
***************
*** 863,869 ****
"" : " ");
LOCAL->buf[0] = '('; /* open list */
mail_date (tmp,elt); /* generate internal date */
! if (!maildir_append (stream,mailbox,LOCAL->buf,tmp,&st)) {
fs_give ((void **) &s); /* give back temporary space */
return NIL;
}
--- 863,869 ----
"" : " ");
LOCAL->buf[0] = '('; /* open list */
mail_date (tmp,elt); /* generate internal date */
! if (!maildir_append_old (stream,mailbox,LOCAL->buf,tmp,&st)) {
fs_give ((void **) &s); /* give back temporary space */
return NIL;
}
***************
*** 872,878 ****
return T; /* return success */
}
! long maildir_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
STRING *message)
{
int fd;
--- 872,890 ----
return T; /* return success */
}
! long maildir_append (MAILSTREAM *stream, char *mailbox, append_t af,
! void *data)
! {
! char *flags, *date;
! STRING *message;
!
! if (!(*af) (stream, data, &flags, &date, &message))
! return NIL;
! else
! return maildir_append_old (stream, mailbox, flags, date, message);
! }
!
! long maildir_append_old (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
STRING *message)
{
int fd;
*** pine4.33-old/imap/src/osdep/unix/maildir.h Thu Sep 13 11:50:04 2001
--- pine4.33/imap/src/osdep/unix/maildir.h Thu Sep 13 11:54:39 2001
***************
*** 39,45 ****
void maildir_flagmsg (MAILSTREAM *stream,MESSAGECACHE *elt);
void maildir_expunge (MAILSTREAM *stream);
long maildir_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long options);
! long maildir_append (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
STRING *message);
short maildir_getflags (MAILSTREAM *stream,char *flag);
long maildir_delete (MAILSTREAM *stream,char *mailbox);
--- 39,46 ----
void maildir_flagmsg (MAILSTREAM *stream,MESSAGECACHE *elt);
void maildir_expunge (MAILSTREAM *stream);
long maildir_copy (MAILSTREAM *stream,char *sequence,char *mailbox,long options);
! long maildir_append (MAILSTREAM *stream,char *mailbox,append_t af,void *data);
! long maildir_append_old (MAILSTREAM *stream,char *mailbox,char *flags,char *date,
STRING *message);
short maildir_getflags (MAILSTREAM *stream,char *flag);
long maildir_delete (MAILSTREAM *stream,char *mailbox);
--
Adrian Ho Tinker, Drifter, Fixer, Bum [EMAIL PROTECTED]
ListArchive: <http://marc.theaimsgroup.com/?l=qmail>
Useful URLs: <http://cr.yp.to/qmail.html> <http://www.qmail.org>
<http://www.lifewithqmail.org/> <http://qmail.faqts.com/>