Fix UNIX mbox driver and mail utility.
The `mail' and `frm' utilities pass tests. * include/mailutils/stream.h (mu_stream_err): New proto. * libproto/mbox/mbox.c (_msg_stream_setup) (_msg_body_setup): Fix stream abridgement. (mbox_envelope_date, mbox_envelope_sender): Fix seek position. (uid_to_stream): Fix invocation of mu_stream_printf. (append_message_to_stream): Likewise. (mbox_expunge_unlocked): Rewind tempstr before copying its contents back to the mailbox. (mbox_expunge0): Open tempstr. * libproto/mbox/mbox0.h (_mbox_message)<header_from>: Rename to envel_from. <header_from_end>: Rename to envel_from_end. All uses changed. * libproto/mbox/mboxscan.c: Minor changes. * mail/decode.c: Use streamrefs. * mail/escape.c: Likewise. * mail/msgset.y: Likewise. * mail/pipe.c: Likewise. * mail/print.c: Likewise. * mail/top.c: Likewise. * mail/write.c: Likewise. * mail/send.c: Use streamrefs. (mail_send0): Reset env->header after assigning it to the message. * mailbox/body.c (_body_seek): Fix a typo which produced a recursive call. * mailbox/file_stream.c (fd_truncate): New function. (_mu_file_stream_create): Initialize str->stream.truncate. * mailbox/header.c (header_parse): Fix parsing of blurbs lacking terminating empty line. (header_seek): Fix boundary checks. Return new position in presult. * mailbox/message.c (string_find_eoh): Rewrite to handle \n\n split between two successive invocations. (_header_fill): Update the invocation of string_find_eoh. * mailbox/stream.c (mu_stream_destroy): Call mu_stream_close. (mu_stream_get_flags, mu_stream_set_flags) (mu_stream_clr_flags): Ignore internal bits. (mu_stream_err): New function. (mu_stream_close): Close the stream only if it is not used by anyone else. * mailbox/streamref.c (_streamref_read): Clear transport error if ESPIPE is returned. (_streamref_size): Take into account sp->end and sp->start. (mu_streamref_create_abridged): Set pointer to 0.
Showing
18 changed files
with
207 additions
and
140 deletions
-
Please register or sign in to post a comment