From owner-freebsd-stable Tue Mar 4 21:13:53 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA23882 for stable-outgoing; Tue, 4 Mar 1997 21:13:53 -0800 (PST) Received: from mailhost.anasazi.com (mailhost.anasazi.com [138.113.128.2]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id VAA23876; Tue, 4 Mar 1997 21:13:48 -0800 (PST) Received: from chad.anasazi.com by mailhost.anasazi.com (5.65/3.7) id AA02093; Tue, 4 Mar 97 22:13:14 -0700 Received: by chad.anasazi.com (5.65/3.7) id AA29197; Tue, 4 Mar 97 22:13:12 -0700 From: chad@anasazi.com (Chad R. Larson) Message-Id: <9703050513.AA29197@chad.anasazi.com> Subject: a2ps port fixes To: jmz@FreeBSD.org Date: Tue, 4 Mar 1997 22:13:10 -0700 (MST) Cc: freebsd-stable@FreeBSD.org Reply-To: chad@anasazi.com X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-stable@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk The reason a2ps does not correctly interpret "bold" in a man page (with the "-m" option) is that the FreeBSD supplied nroff only overstrikes bold text once. Apparently the author(s) of a2ps are on a machine that overstikes twice. This meant the test for strings with embedded back-space characters was failing. When I fixed that, it broke underlining. I hate it when that happens. Anyway, attached are context diffs for the consolidated fixes. Works for FreeBSD, but now might be broken for other implementations of nroff. Perhaps someone would like to get back to the original authors and suggest style of overstrike strings being tested for be made some "#define" option. -crl -- Chad R. Larson (CRL22) Brother, can you paradigm? 602-870-3330 chad@anasazi.com chad@anasaz.UUCP chad@dcfinc.com Anasazi, Inc. - 7500 North Dreamy Draw Drive, Suite 120, Phoenix, Az 85020 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= *** a2ps.c.orig 1997/03/05 03:26:54 1.2 --- a2ps.c 1997/03/05 04:57:25 *************** *** 732,739 **** /* * This routine buffers a line of input, release one character at a time * or a whole sequence of characters with some meaning like bold sequences ! * produced by nroff (no others sequences are recognized by the moment): ! * <\b><\b><\b> */ int mygetc(statusp) --- 732,740 ---- /* * This routine buffers a line of input, release one character at a time * or a whole sequence of characters with some meaning like bold sequences ! * or underlining produced by nroff. ! * <\b> ! * <_><\b> */ int mygetc(statusp) *************** *** 761,780 **** if (buffer[curr+1] != '\b') /* this is not a special sequence */ return buffer[curr++]; /* Check if it is a bold sequence */ ! c = buffer[curr++]; ! if (c == buffer[curr+1] && ! buffer[curr] == buffer[curr+2] && ! c == buffer[curr+3] && ! buffer[curr] == buffer[curr+4] && ! c == buffer[curr+5]) { *statusp = IS_BOLD; ! curr += 6; } ! ! /* Return the first character of the sequence */ ! return c; } /* --- 762,778 ---- if (buffer[curr+1] != '\b') /* this is not a special sequence */ return buffer[curr++]; + /* check if we're underlining */ + if (buffer[curr] == '_') + return buffer[curr++]; + /* Check if it is a bold sequence */ ! if ((c = buffer[curr]) == buffer[curr+2]) { *statusp = IS_BOLD; ! curr += 3; } ! return c; /* Return the first character of the sequence */ } /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=