Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!rocksvax!rocksanne!sunybcs!colonel From: colonel@sunybcs.UUCP (Col. G. L. Sicherman) Newsgroups: net.bugs.4bsd Subject: fix to colcrt - fold unders onto blanks Message-ID: <1112@sunybcs.UUCP> Date: Wed, 8-Oct-86 10:19:54 EDT Article-I.D.: sunybcs.1112 Posted: Wed Oct 8 10:19:54 1986 Date-Received: Fri, 10-Oct-86 00:06:47 EDT Organization: DALEK Reproducing Equipment, Inc. Lines: 56 As the man page for colcrt(1) says under BUGS, underlines ought to be folded onto blanks, BUT blah blah blah! What we want is to view a line like Has anybody seen my foo_bar? as itself, and not as Has anybody seen my foo bar? - Here are diffs to do it. The line numbers may be off a bit. As usual, the proprietary etc. precludes etc. clearer posting. A minor tradeoff is that if you really feed Example 2 in, you'll get Example 1 out. !38a33 !> char dontsplitbl; !59a55,57 !> case 'b': !> dontsplitbl = 1; !> break; !61c59 !< printf("usage: %s [ - ] [ -2 ] [ file ... ]\n", progname); !--- !> printf("usage: %s [ - ] [ -2 ] [ -b ] [ file ... ]\n", progname); !185a183,184 !> if (dontsplitbl && i%2 != 0 && canmerge(page[i],page[i+1])) !> merge(page[i],page[i+1]); !224a224,246 !> !> /* !> * The Colonel's stuff. !> */ !> !> int !> canmerge(a,b) !> char a[132], b[132]; !> { !> register int i; !> for (i=0; a[i] && b[i] && i<132; i++) !> if ((' '!=a[i] || '-'!=b[i]) && ' '!=b[i]) return 0; !> return 1; !> } !> !> merge(a,b) !> char a[132], b[132]; !> { !> register int i; !> for (i=0; b[i] && i<132; i++) !> if (' '==a[i] || !a[i]) a[i] = '-'==b[i]? '_': b[i]; !> bzero(b,132); -- Col. G. L. Sicherman UU: ...{rocksvax|decvax}!sunybcs!colonel CS: colonel@buffalo-cs BI: colonel@sunybcs, csdsiche@sunyabvc