X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/de06ed5f176a5fa3eb5522bb9a9741f9c3f1d0f4..90edf2e26c34b9ee225cb066eed069b9b7394c43:/uip/sortm.c diff --git a/uip/sortm.c b/uip/sortm.c index 7e966db6..0b951bfe 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -7,8 +7,9 @@ #include #include +#include "h/done.h" #include -#include "../sbr/m_maildir.h" +#include "sbr/m_maildir.h" #define SORTM_SWITCHES \ X("datefield field", 0, DATESW) \ @@ -321,7 +322,7 @@ read_hdrs (struct msgs *mp, char *datesw) } } s->s_msg = 0; - return(s - smsgs); + return s - smsgs; } @@ -343,7 +344,7 @@ get_fields (char *datesw, int msg, struct smsg *smsg) if ((in = fopen (msgnam = m_name (msg), "r")) == NULL) { admonish (msgnam, "unable to read message"); - return (0); + return 0; } gstate = m_getfld_state_init(in); for (compnum = 1;;) { @@ -390,10 +391,10 @@ get_fields (char *datesw, int msg, struct smsg *smsg) msg, compnum); check_failed = 1; } - mh_xfree(datecomp); - mh_xfree(subjcomp); + free(datecomp); + free(subjcomp); fclose (in); - return (0); + return 0; default: adios (NULL, "internal error -- you lose"); @@ -453,9 +454,9 @@ get_fields (char *datesw, int msg, struct smsg *smsg) smsg->s_subj = subjcomp; } fclose (in); - mh_xfree(datecomp); + free(datecomp); - return (1); + return 1; } /* @@ -465,12 +466,12 @@ static int dsort (struct smsg **a, struct smsg **b) { if ((*a)->s_clock < (*b)->s_clock) - return (-1); + return -1; if ((*a)->s_clock > (*b)->s_clock) - return (1); + return 1; if ((*a)->s_msg < (*b)->s_msg) - return (-1); - return (1); + return -1; + return 1; } /* @@ -482,9 +483,9 @@ subsort (struct smsg **a, struct smsg **b) int i; if ((i = strcmp ((*a)->s_subj, (*b)->s_subj))) - return (i); + return i; - return (dsort (a, b)); + return dsort(a, b); } static int @@ -493,10 +494,10 @@ txtsort (struct smsg **a, struct smsg **b) int i; if ((i = strcmp ((*a)->s_subj, (*b)->s_subj))) - return (i); + return i; if ((*a)->s_msg < (*b)->s_msg) - return (-1); - return (1); + return -1; + return 1; } static void