From owner-freebsd-audit Mon Apr 30 20:46:19 2001 Delivered-To: freebsd-audit@freebsd.org Received: from lennier.cc.vt.edu (lennier.cc.vt.edu [198.82.161.193]) by hub.freebsd.org (Postfix) with ESMTP id E9BF837B423 for ; Mon, 30 Apr 2001 20:46:15 -0700 (PDT) (envelope-from mheffner@vt.edu) Received: from mail.vt.edu (gkar.cc.vt.edu [198.82.161.190]) by lennier.cc.vt.edu (8.11.0/8.11.0) with ESMTP id f413kEu256214 for ; Mon, 30 Apr 2001 23:46:14 -0400 (EDT) Received: from enterprise.muriel.penguinpowered.com ([198.82.100.151]) by gkar.cc.vt.edu (Sun Internet Mail Server sims.3.5.2000.03.23.18.03.p10) with ESMTP id <0GCN00DTD152RQ@gkar.cc.vt.edu> for FreeBSD-audit@freebsd.org; Mon, 30 Apr 2001 23:46:14 -0400 (EDT) Date: Mon, 30 Apr 2001 23:44:42 -0400 (EDT) From: Mike Heffner Subject: Small patch to allow mail to read Eudora mailboxes To: FreeBSD-audit Message-id: MIME-version: 1.0 X-Mailer: XFMail 1.4.7 on FreeBSD Content-type: multipart/signed; boundary="_=XFMail.1.4.7.FreeBSD:20010430234442:439=_"; micalg=pgp-md5; protocol="application/pgp-signature" X-Priority: 3 (Normal) Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format --_=XFMail.1.4.7.FreeBSD:20010430234442:439=_ Content-Type: text/plain; charset=us-ascii Found this in the OpenBSD tree, I'd like to commit it to our mail(1). Any objections to this? Index: fio.c =================================================================== RCS file: /home/ncvs/src/usr.bin/mail/fio.c,v retrieving revision 1.4 diff -u -r1.4 fio.c --- fio.c 2001/03/25 04:57:04 1.4 +++ fio.c 2001/05/01 03:41:37 @@ -94,6 +94,14 @@ return; } count = strlen(linebuf); + /* + * Transforms lines ending in to just . + * This allows mail to be able to read Eudora mailboxes. + */ + if (count >= 2 && linebuf[count-1] == '\n' && + linebuf[count - 2] == '\r') + linebuf[count - 2] = linebuf[--count]; + (void) fwrite(linebuf, sizeof *linebuf, count, otf); if (ferror(otf)) errx(1, "/tmp"); @@ -160,7 +168,7 @@ /* * Read up a line from the specified input into the line * buffer. Return the number of characters read. Do not - * include the newline at the end. + * include the newline (or carriage return) at the end. */ int readline(ibuf, linebuf, linesize) @@ -175,6 +183,8 @@ return -1; n = strlen(linebuf); if (n > 0 && linebuf[n - 1] == '\n') + linebuf[--n] = '\0'; + if (n > 0 && linebuf[n - 1] == '\r') linebuf[--n] = '\0'; return n; } Mike -- Mike Heffner Blacksburg, VA http://filebox.vt.edu/users/mheffner --_=XFMail.1.4.7.FreeBSD:20010430234442:439=_ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE67jEqFokZQs3sv5kRAh4bAJ49rsKOyR6nZt9AFhatCTgEu520iQCfYtPm oAWr89t5haKCYnBVfaK9mjE= =2yuk -----END PGP SIGNATURE----- --_=XFMail.1.4.7.FreeBSD:20010430234442:439=_-- End of MIME message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message