Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!helios.ee.lbl.gov!ace.ee.lbl.gov!leres From: leres@ace.ee.lbl.gov (Craig Leres) Newsgroups: comp.mail.mh Subject: Re: Extra blank lines in MHL Message-ID: <2813@helios.ee.lbl.gov> Date: 13 Jun 89 00:20:32 GMT References: <840@csisles.Bristol.AC.UK> <5740005@hpscdc.HP.COM> Sender: usenet@helios.ee.lbl.gov Reply-To: leres@helios.ee.lbl.gov (Craig Leres) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 45 Summary: Expires: Sender: Followup-To: Distribution: Keywords: Neil Davies wrote: > Does anyone out there know how to suppress the blank line that follows any > field used with the formatfield option, eg > > Date:formatfield="%<(nodate{text})%{text}%|%(pretty{text})%>" > To: gregg.g.wonderly wrote: > The problem is more with dates than anything else. Think of what ctime(3) > returns and you will understand why. The solution is a code modification to > eliminate the newline from the buffer. Actually, ctime(3) isn't used, a mh routine called dctime() is the one that's adding the newline. John Schmitz provided a working patch to mhlsbr.c. Still, I prefer minimalistic changes so my patch is appended. It's good to see so much interest in mh these days! Craig ------ RCS file: RCS/mhlsbr.c,v retrieving revision 1.3 diff -c -r1.3 mhlsbr.c *** /tmp/,RCSt1a10531 Mon Jun 12 17:11:12 1989 --- mhlsbr.c Mon Jun 12 17:11:04 1989 *************** *** 952,958 **** cptr -> c_text = ap; (void) fmtscan (c1 -> c_fmt, buffer, sizeof buffer - 1, dat); ! c2 -> c_text = concat (buffer, "\n", NULLCP); free (ap); return; --- 952,959 ---- cptr -> c_text = ap; (void) fmtscan (c1 -> c_fmt, buffer, sizeof buffer - 1, dat); ! /* Don't need to append a newline, dctime() already did */ ! c2 -> c_text = getcpy (buffer); free (ap); return;