Date: Tue, 4 Mar 1997 22:13:10 -0700 (MST) From: chad@anasazi.com (Chad R. Larson) To: jmz@FreeBSD.org Cc: freebsd-stable@FreeBSD.org Subject: a2ps port fixes Message-ID: <9703050513.AA29197@chad.anasazi.com>
next in thread | raw e-mail | index | archive | help
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): ! * <c><\b><c><\b><c><\b><c> */ 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. ! * <c><\b><c> ! * <_><\b><c> */ 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 */ } /* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9703050513.AA29197>