From owner-freebsd-bugs@FreeBSD.ORG Mon Sep 19 18:30:10 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21E9D16A41F for ; Mon, 19 Sep 2005 18:30:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC3E343D55 for ; Mon, 19 Sep 2005 18:30:08 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j8JIU838083997 for ; Mon, 19 Sep 2005 18:30:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j8JIU8XK083979; Mon, 19 Sep 2005 18:30:08 GMT (envelope-from gnats) Resent-Date: Mon, 19 Sep 2005 18:30:08 GMT Resent-Message-Id: <200509191830.j8JIU8XK083979@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Matej Vela Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B58CB16A41F for ; Mon, 19 Sep 2005 18:22:37 +0000 (GMT) (envelope-from mvela@irb.hr) Received: from mail.irb.hr (mail.irb.hr [161.53.22.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8FBCD43D49 for ; Mon, 19 Sep 2005 18:22:36 +0000 (GMT) (envelope-from mvela@irb.hr) Received: from diziet.irb.hr (diziet.irb.hr [161.53.22.31]) by mail.irb.hr (8.13.3/8.13.3/Debian-6) with ESMTP id j8JIMFM0006089 for ; Mon, 19 Sep 2005 20:22:15 +0200 Received: from diziet.irb.hr (localhost [127.0.0.1]) by diziet.irb.hr (8.13.5/8.13.5/Debian-1) with ESMTP id j8JIMXTK022575 for ; Mon, 19 Sep 2005 20:22:33 +0200 Received: (from mvela@localhost) by diziet.irb.hr (8.13.5/8.13.5/Submit) id j8JIMXg7022573 for FreeBSD-gnats-submit@freebsd.org; Mon, 19 Sep 2005 20:22:33 +0200 Message-Id: <20050919182233.GO7473@diziet.irb.hr> Date: Mon, 19 Sep 2005 20:22:33 +0200 From: Matej Vela To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/86343: [patch] tmac.vgrind: groff cleanup broke indexing X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matej Vela List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Sep 2005 18:30:10 -0000 >Number: 86343 >Category: bin >Synopsis: [patch] tmac.vgrind: groff cleanup broke indexing >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 19 18:30:07 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Matej Vela >Release: FreeBSD-CURRENT >Organization: Debian >Environment: N/A >Description: In revision 1.2 of src/usr.bin/vgrind/tmac.vgrind, the following change was made to eliminate warnings from groff(1): --- src/usr.bin/vgrind/tmac.vgrind 1994/05/27 12:33:20 1.1 +++ src/usr.bin/vgrind/tmac.vgrind 2000/11/29 10:32:51 1.2 @@ -54,11 +58,9 @@ .. 'de FN \f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c -.if \\nx .tm \\$1 \\*(=F \\n% 'ds =f \&...\\$1 .. 'de FC -.if \\nx .tm \\$1 \\*(=F \\n% 'ds =f \&...\\$1 .. 'de -F What the two removed lines say in their wonderfully concise way is, if the numeric register `x' is non-zero [1], output the function name [2], the name of the current file [3], and the current page number [4] to the index file [5] for a second pass by `vgrind -x'. [1] I.e. if vgrind.sh invoked groff(1) with `-rx1' to enable indexing. [2] `\$1', the first argument to FN and FC. [3] Variable `=F', defined by vfontedpr.c:271. [4] Register `%', maintained by groff(1) itself. [5] Or to be precise, to standard error, which vgrind.sh redirects to the index file. The reason they were removed is that they cause `register not defined' warnings if vgrind.sh doesn't supply `-rx1'. However, removing them completely breaks indexing. >How-To-Repeat: $ cd src/usr.bin/vgrind $ > index $ vgrind -p groff vgrindefs.c > source.ps $ file index index: empty The correct behavior looks like this: $ > index $ vgrind -p groff vgrindefs.c > source.ps $ cat index tdecode vgrindefs.c 5 tgetent vgrindefs.c 2 tgetflag vgrindefs.c 4 tgetnum vgrindefs.c 4 tgetstr vgrindefs.c 5 tnamatch vgrindefs.c 3 tnchktc vgrindefs.c 3 tskip vgrindefs.c 4 $ vgrind -p groff -x index > index.ps >Fix: Fix the groff(1) warnings without removing the offending lines, by making sure `\nx' and `\*(=F' are used only when defined (`if r x', `if d =F'): --- src/usr.bin/vgrind/tmac.vgrind.orig +++ src/usr.bin/vgrind/tmac.vgrind @@ -58,9 +58,11 @@ .. 'de FN \f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c +.if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n% 'ds =f \&...\\$1 .. 'de FC +.if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n% 'ds =f \&...\\$1 .. 'de -F >Release-Note: >Audit-Trail: >Unformatted: