Oops! The previous patch I posted contains a bug where an empty line will be introduced into the header if the address contains no spaces or commas at all. Here's an updated patch. Sorry for the inconvenience. Thanks, Ruud de Rooij. -- Ruud de Rooij [EMAIL PROTECTED] http://sepc.twi.tudelft.nl/~derooij/ --- nmh-1.0.orig/sbr/fmt_scan.c +++ nmh-1.0/sbr/fmt_scan.c @@ -731,22 +731,34 @@ /* try to break at a comma; failing that, break at a * space, failing that, just split the line. */ + /* Changed so it won't "just split the line". + * Ruud de Rooij <[EMAIL PROTECTED]> + * Mon, 29 Mar 1999 23:08:54 +0200 + */ lastb = 0; sp = lp + wid; while (sp > lp && (c = *--sp) != ',') { if (! lastb && isspace(c)) lastb = sp - 1; } if (sp == lp) - if (! (sp = lastb)) + if (! (sp = lastb)) { sp = lp + wid - 1; + while (*sp && *sp != ',' && !isspace(*sp)) + sp++; + if (*sp != ',') + sp--; + } len -= sp - lp + 1; while (cp < ep && lp <= sp) *cp++ = *lp++; - *cp++ = '\n'; - for (i=indent; cp < ep && i > 0; i--) - *cp++ = ' '; while (isspace(*lp)) lp++, len--; + if (*lp) { + if (cp < ep) + *cp++ = '\n'; + for (i=indent; cp < ep && i > 0; i--) + *cp++ = ' '; + } } PUTS (cp, lp); }
