NetBSD Problem Report #49481

From www@NetBSD.org  Tue Dec 16 15:25:37 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 57518A6552
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 16 Dec 2014 15:25:37 +0000 (UTC)
Message-Id: <20141216152536.156E4A6554@mollari.NetBSD.org>
Date: Tue, 16 Dec 2014 15:25:36 +0000 (UTC)
From: pooka@iki.fi
Reply-To: pooka@iki.fi
To: gnats-bugs@NetBSD.org
Subject: groff -mandoc terminates output if reference contains the word No
X-Send-Pr-Version: www-1.0

>Number:         49481
>Category:       bin
>Synopsis:       groff -mandoc terminates output if reference contains the word No
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 16 15:30:00 +0000 2014
>Closed-Date:    Tue Dec 16 23:01:35 +0000 2014
>Last-Modified:  Wed Dec 17 13:25:00 +0000 2014
>Originator:     Antti Kantee
>Release:        
>Organization:
>Environment:
>Description:
In case a reference in a mandoc (i.e. something between .Rs/.Re) contains the word No, groff punts.

That is, unless, logically, No is in quotation marks, except in the case that the entire string is just "No".

So for example the following is fine:

.%A "Dr. No"

while the following fail:

.%A Dr. No

and

.%T "No"

While this behaviour might be documented somewhere, it is against POLA, at least in my opinion.
>How-To-Repeat:
pooka@watou:~$ cat test.man
.Dd 1234
.Sh NAME
.Nm testpage
.Os
.Sh DESC
.Rs
.%A works
.%T Yes
.Re
.Pp
.Rs
.%A fails
.%T No
.Re
.Pp
no output
pooka@watou:~$ groff -Tascii -mandoc test.man
test.man:14: cannot chop empty macro
test.man:14: cannot chop empty macro
troff: automatically ending diversion `reference-title-name' on exit
troff: automatically ending diversion `reference-title-name-for-book' on exit
UNTITLED                             LOCAL                            UNTITLED

NAME
     testpage

DESC
     works, Yes.

pooka@watou:~$ 


Notice how not even the footer is produced.
>Fix:

>Release-Note:

>Audit-Trail:
From: Steffen Nurpmeso <sdaoden@yandex.com>
To: gnats-admin@netbsd.org, gnats-bugs@NetBSD.org,
 netbsd-bugs@netbsd.org
Cc: 
Subject: Re: bin/49481: groff -mandoc terminates output if
 reference contains the word No
Date: Tue, 16 Dec 2014 17:30:07 +0100

 pooka@iki.fi wrote:
  |>Number:         49481
  |>Category:       bin
  |>Synopsis:       groff -mandoc terminates output if reference \
  |>contains the word No
  |>Confidential:   no
  |>Severity:       serious
  |>Priority:       medium
  |>Responsible:    bin-bug-people
  |>State:          open
  |>Class:          sw-bug
  |>Submitter-Id:   net
  |>Arrival-Date:   Tue Dec 16 15:30:00 +0000 2014
  |>Originator:     Antti Kantee
  |>Release:       =20
  |>Organization:
  |>Environment:
  |>Description:
  |In case a reference in a mandoc (i.e. something between .Rs/.Re) \
  |contains the word No, groff punts.
  |
  |That is, unless, logically, No is in quotation marks, except \
  |in the case that the entire string is just "No".
  |
  |So for example the following is fine:
  |
  |.%A "Dr. No"
  |
  |while the following fail:
  |
  |.%A Dr. No

 You must say \&No, `No' is a mdoc(7) command ("normal text").

 --steffen

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Tue, 16 Dec 2014 23:01:35 +0000
State-Changed-Why:
Not a bug. Macros on macro lines must be quoted, that is how this works.
Sorry.


From: Antti Kantee <pooka@iki.fi>
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, 
 netbsd-bugs@netbsd.org, wiz@NetBSD.org
Cc: 
Subject: Re: bin/49481 (groff -mandoc terminates output if reference contains
 the word No)
Date: Tue, 16 Dec 2014 23:21:50 +0000

 On 16/12/14 23:01, wiz@NetBSD.org wrote:
 > Synopsis: groff -mandoc terminates output if reference contains the word No
 >
 > State-Changed-From-To: open->closed
 > State-Changed-By: wiz@NetBSD.org
 > State-Changed-When: Tue, 16 Dec 2014 23:01:35 +0000
 > State-Changed-Why:
 > Not a bug. Macros on macro lines must be quoted, that is how this works.
 > Sorry.

 My bad, filed this against the wrong software.

 fixed it: bin/49485

From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/49481: groff -mandoc terminates output if reference contains
 the word No
Date: Wed, 17 Dec 2014 14:22:17 +0100

 This discussion was continued in PR 49485.

 A short summary:
 "No" must be quoted on a macro line, otherwise it is parsed.
 That is not a bug.

 That the "No" macro without an argument terminates output is a bug.
 However, I don't think it'll be fixed in NetBSD; it should be tested
 on a recent version of groff and reported upstream, if it still occurs.

 (If someone is motived to fix it in the in-tree groff (1.19.2, current
 groff is 1.22.x), they are welcome to do so, but I don't see the point
 since we're using mandoc for all man pages, and it's arguably invalid
 input anyway.)
  Thomas

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.