Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jul 2011 14:17:33 +0200
From:      Ulrich =?utf-8?B?U3DDtnJsZWlu?= <uqs@spoerlein.net>
To:        d@delphij.net, ru@FreeBSD.org
Cc:        FreeBSD Current <freebsd-current@FreeBSD.org>
Subject:   Re: weekly_catman not generating the right result?
Message-ID:  <20110731121732.GB11991@acme.spoerlein.net>
In-Reply-To: <4E3510CC.8090300@delphij.net>
References:  <4E3510CC.8090300@delphij.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--4bRzO86E/ozDv8r1
Content-Type: multipart/mixed; boundary="C7zPtVaVf+AK4Oqc"
Content-Disposition: inline


--C7zPtVaVf+AK4Oqc
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, 2011-07-31 at 01:22:36 -0700, Xin LI wrote:
> Hi,
>=20
> I just noticed that weekly_catman is not generating the right result,
> e.g. instead of a highlight NAME, it gives 1mNAME0m (looks like the
> escape character is missing here).
>=20
> Is this a known issue?

Now it is :)

This is due to the recent changes that made groff emit ANSI sequences
and catman(1) is still putting col(1) in the pipe, which is not really
required and gobbles up part of the escape sequences.

Please try the attached patch. Thanks.
Uli

--C7zPtVaVf+AK4Oqc
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment; filename="catman.diff"
Content-Transfer-Encoding: quoted-printable

commit 363e4ce24b5017eb060d6a54bebbf92608ba3873
Author: Ulrich Sp=C3=B6rlein <uqs@spoerlein.net>
Date:   Sun Jul 31 14:13:51 2011 +0200

    Unbreak catman(1) by removing calls to col(1).
   =20
    col(1) was mangling the SGR escapes and is not strictly required. Tab
    "compression" is now done by passing -h to nroff directly.
   =20
    See r222650 and r222653 for more details.
   =20
    Reviewed by:   ?
    Approved by:   ?
    MFC after:     3 weeks

diff --git a/usr.bin/catman/catman.c b/usr.bin/catman/catman.c
index c17a091..886563b 100644
--- a/usr.bin/catman/catman.c
+++ b/usr.bin/catman/catman.c
@@ -432,7 +432,7 @@ process_page(char *mandir, char *src, char *cat, enum Z=
iptype zipped)
 	}
 	snprintf(tmp_file, sizeof tmp_file, "%s.tmp", cat);
 	snprintf(cmd, sizeof cmd,
-	    "%scat %s | tbl | nroff -T%s -man | col | %s > %s.tmp",
+	    "%scat %s | tbl | nroff -h -T%s -man | %s > %s.tmp",
 	    zipped =3D=3D BZIP ? BZ2CAT_CMD : zipped =3D=3D GZIP ? GZCAT_CMD : "",
 	    src, nroff_device,
 	    zipped =3D=3D BZIP ? BZ2_CMD : zipped =3D=3D GZIP ? GZ_CMD : "cat",

--C7zPtVaVf+AK4Oqc--

--4bRzO86E/ozDv8r1
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iQEcBAEBAgAGBQJONUfcAAoJEKOmmGRKr4LOPRMH/iLM7Im3emFm/jYNVsITt9f6
5t7xy3sdRiiZpQ+ET5KehJa1QyO3w84WMG3TqPJu9TxrAz4xIRgT9Z3NKXTtpNXc
ZCQcwc+00mbEW1XlZL0ITLEwopEDfpsKZS6Dzin/u6RRprnSGwr7nn84AHJv6e1d
/YqX+OT1X5UY71cfBwISvc3EncRtHb2y1xs+6I7XouC7zPJxV4x0skQRu7Rg/+du
8wsEsRWOw5EcZpvnScnlxShnd8o2Y873OF1fHO+gw8EMixeYUA7e2+XooBBTf/kK
7Kot4SHV/CM2kRjkYPocYVxckY6o5/5XRip0sxqyFOUoeiWXuyFL+CQXGPXwgoU=
=hDK0
-----END PGP SIGNATURE-----

--4bRzO86E/ozDv8r1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110731121732.GB11991>