/[mailutils]/mailutils/mailbox/mbx_mh.c
ViewVC logotype

Diff of /mailutils/mailbox/mbx_mh.c

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

revision 1.33 by gray, Sat Jan 18 21:57:04 2003 UTC revision 1.34 by gray, Sat Feb 8 02:17:15 2003 UTC
# Line 488  _mh_tempfile(struct _mh_data *mhd, char Line 488  _mh_tempfile(struct _mh_data *mhd, char
488  }  }
489    
490  static int  static int
491    _mh_delim (char *str)
492    {
493      if (str[0] == '-')
494        {
495          for (; *str == '-'; str++)
496            ;
497          for (; *str == ' ' || *str == '\t'; str++)
498            ;
499        }
500      return str[0] == '\n';
501    }
502    
503    static int
504  _mh_message_save (struct _mh_data *mhd, struct _mh_message *mhm, int expunge)  _mh_message_save (struct _mh_data *mhd, struct _mh_message *mhm, int expunge)
505  {  {
506    stream_t stream = NULL;    stream_t stream = NULL;
# Line 540  _mh_message_save (struct _mh_data *mhd, Line 553  _mh_message_save (struct _mh_data *mhd,
553    while ((status = stream_readline (stream, buf, bsize, off, &n)) == 0    while ((status = stream_readline (stream, buf, bsize, off, &n)) == 0
554           && n != 0)           && n != 0)
555      {      {
556        if (buf[0] == '\n')        if (_mh_delim(buf))
557          break;          break;
558    
559        nlines++;        nlines++;
# Line 559  _mh_message_save (struct _mh_data *mhd, Line 572  _mh_message_save (struct _mh_data *mhd,
572    
573    /* Add imapbase */    /* Add imapbase */
574    if (!mhd->msg_head || (mhd->msg_head == mhm)) /*FIXME*/    if (!mhd->msg_head || (mhd->msg_head == mhm)) /*FIXME*/
575      fprintf (fp, "X-IMAPbase: %lu %u\n",      {
576               (unsigned long) mhd->uidvalidity, (unsigned) _mh_next_seq(mhd));        fprintf (fp, "X-IMAPbase: %lu %u\n",
577                   (unsigned long) mhd->uidvalidity, (unsigned) _mh_next_seq(mhd));
578          nlines++;
579        }
580      
581    message_get_envelope (msg, &env);    message_get_envelope (msg, &env);
582    if (envelope_date (env, buffer, sizeof buffer, &n) == 0 && n > 0)    if (envelope_date (env, buffer, sizeof buffer, &n) == 0 && n > 0)
583      {      {
# Line 570  _mh_message_save (struct _mh_data *mhd, Line 586  _mh_message_save (struct _mh_data *mhd,
586        while (isspace (*p))        while (isspace (*p))
587          p++;          p++;
588        fprintf (fp, "%s: %s", MH_ENV_DATE_HEADER, p);        fprintf (fp, "%s: %s", MH_ENV_DATE_HEADER, p);
589          nlines++;
590      }      }
591                        
592    if (envelope_sender (env, buffer, sizeof buffer, &n) == 0 && n > 0)    if (envelope_sender (env, buffer, sizeof buffer, &n) == 0 && n > 0)
593      fprintf (fp, "%s: %s\n", MH_ENV_SENDER_HEADER, buffer);      {
594          fprintf (fp, "%s: %s\n", MH_ENV_SENDER_HEADER, buffer);
595          nlines++;
596        }
597        
598    /* Add status */    /* Add status */
599    message_get_attribute (msg, &attr);    message_get_attribute (msg, &attr);
600    attribute_to_string (attr, buf, bsize, &n);    attribute_to_string (attr, buf, bsize, &n);
601    fprintf (fp, "%s", buf);    fprintf (fp, "%s", buf);
602    fprintf (fp, "\n");    fprintf (fp, "\n");
603      nlines += 2;
604        
605    /* Copy message body */    /* Copy message body */
606    

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

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