[17537] in Athena Bugs
Re: exmh bug
daemon@ATHENA.MIT.EDU (Jacob Morzinski)
Sat Feb 12 04:52:15 2000
Message-Id: <200002120952.EAA19558@quiche-lorraine.mit.edu>
To: bugs@MIT.EDU
In-Reply-To: <Pine.LNX.4.21.0002112301560.16264-100000@quiche-lorraine.mit.edu>
Date: Sat, 12 Feb 2000 04:52:11 EST
From: "Jacob Morzinski" <jmorzins@MIT.EDU>
On Sat, 12 Feb 2000, Jacob Morzinski wrote:
> Maybe it would be reasonable to change this to not split in the
> middle of lines.
On further reflection, I'm not sure when you'd ever want to split
an email address across lines. Here's a proposed patch, which
doesn't let nmh's putaddr split addresses. Testing on Solaris
seems to work well enough.
*** fmt_scan.c.orig Sun Feb 7 13:14:08 1999
--- fmt_scan.c Sat Feb 12 04:41:54 2000
***************
*** 729,735 ****
*cp++ = c;
while (len > wid) {
/* try to break at a comma; failing that, break at a
! * space, failing that, just split the line.
*/
lastb = 0; sp = lp + wid;
while (sp > lp && (c = *--sp) != ',') {
--- 729,735 ----
*cp++ = c;
while (len > wid) {
/* try to break at a comma; failing that, break at a
! * space, failing that, print the whole address
*/
lastb = 0; sp = lp + wid;
while (sp > lp && (c = *--sp) != ',') {
***************
*** 737,744 ****
lastb = sp - 1;
}
if (sp == lp)
! if (! (sp = lastb))
! sp = lp + wid - 1;
len -= sp - lp + 1;
while (cp < ep && lp <= sp)
*cp++ = *lp++;
--- 737,755 ----
lastb = sp - 1;
}
if (sp == lp)
! if (! (sp = lastb)) { /* If no ',' or ' ', */
! lastb = 0; sp = lp + wid - 1;
! while (c = *++sp) { /* then search forward. */
! if (c == ',')
! break;
! if (isspace(c)) {
! --sp;
! break;
! }
! }
! if (! *sp) /* If we didn't find comma or space */
! break; /* then PUTS the whole str now */
! }
len -= sp - lp + 1;
while (cp < ep && lp <= sp)
*cp++ = *lp++;