/[mailutils]/mailutils/mh/mh_init.c
ViewVC logotype

Diff of /mailutils/mh/mh_init.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by gray, Wed Sep 18 21:19:29 2002 UTC revision 1.14 by gray, Thu Sep 19 15:00:30 2002 UTC
# Line 418  mh_iterate (mailbox_t mbox, mh_msgset_t Line 418  mh_iterate (mailbox_t mbox, mh_msgset_t
418              mh_iterator_fp itr, void *data)              mh_iterator_fp itr, void *data)
419  {  {
420    int rc;    int rc;
421    int last = 0;    size_t i;
   size_t i, total = 0;  
422    
423    if (rc = mailbox_messages_count (mbox, &total))    for (i = 0; i < msgset->count; i++)
     {  
       mh_error ("can't count messages in %s: %s",  
                 current_folder, mu_errstring (rc));  
       exit (1);  
     }  
           
   for (i = 1; i <= total; i++)  
424      {      {
425        message_t msg;        message_t msg;
426        size_t num;        size_t num;
       int rc;  
         
       if ((rc = mailbox_get_message (mbox, i, &msg)) != 0)  
         {  
           mh_error ("can't get message %d: %s", i, mu_errstring (rc));  
           return 1;  
         }  
427    
428        if ((rc = mh_message_number (msg, &num)) != 0)        num = msgset->list[i];
429          if ((rc = mailbox_get_message (mbox, num, &msg)) != 0)
430          {          {
431            mh_error ("can't get sequence number for message %d: %s",            mh_error ("can't get message %d: %s", num, mu_errstring (rc));
                     i, mu_errstring (rc));  
432            return 1;            return 1;
433          }          }
434    
435        rc = mh_msgset_member (msgset, num);        itr (mbox, msg, num, data);
       if (rc == last + 1)  
         {  
           itr (mbox, msg, num, data);  
           last = rc;  
         }  
       else if (rc && last && last < msgset->count)  
         break;  
     }  
   if (last < msgset->count)  
     {  
       mh_error ("message %d does not exist", msgset->list[last]);  
       exit (1);  
436      }      }
437    
438    return 0;    return 0;

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26