Re: weekly_catman not generating the right result?



On Sun, 2011-07-31 at 01:22:36 -0700, Xin LI wrote:
Hi,

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).

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
commit 363e4ce24b5017eb060d6a54bebbf92608ba3873
Author: Ulrich Spörlein <uqs@xxxxxxxxxxxxx>
Date: Sun Jul 31 14:13:51 2011 +0200

Unbreak catman(1) by removing calls to col(1).

col(1) was mangling the SGR escapes and is not strictly required. Tab
"compression" is now done by passing -h to nroff directly.

See r222650 and r222653 for more details.

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 Ziptype 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 == BZIP ? BZ2CAT_CMD : zipped == GZIP ? GZCAT_CMD : "",
src, nroff_device,
zipped == BZIP ? BZ2_CMD : zipped == GZIP ? GZ_CMD : "cat",

Attachment: pgpuj1ockuuxr.pgp
Description: PGP signature



Relevant Pages

  • Re: basic expect script to send ^]
    ... Expect book is missing... ... I know I need to send it literal but if I escape it \^\] it still does not work. ... spawn telnet host1 ... expect "Escape character is '^]'." ...
    (comp.lang.tcl)
  • Re: regex in filenames
    ... the empty string and the pattern? ... '\' is used as an escape character in some syntaxes which is ... But you added the escape syntax. ... To solve the problem fully you don't need any new escape syntax, ...
    (comp.lang.c)
  • Re: Working with sshs escape character
    ... I have never had the ssh escape character ... +the correct conditions for ssh to catch the escape character. ... But what is special about a login shell? ...
    (Debian-User)
  • Re: Escape character treatment in string library functions
    ... Can I change the escape character used by string libraries?. ... treat '\r' etc special making it difficult to parse even char by ...
    (comp.programming)
  • Re: [RFC PATCH 0/5] Shadow directories
    ... The '^' is an escape character and it tells the computer to treat the file as a directory. ... We can start VFS servers and chroot the whole user session into ... since NTFS-3G is proof of concept that FUSE ...
    (Linux-Kernel)