From phantom@scorpion.crimea.ua Sun Aug 29 10:22:32 1999
Return-Path: <phantom@scorpion.crimea.ua>
Received: from sonet.crimea.ua (OTC-sl3-FLY.CRIS.NET [212.110.136.71])
	by hub.freebsd.org (Postfix) with ESMTP id 31F451537E
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 29 Aug 1999 10:21:39 -0700 (PDT)
	(envelope-from phantom@scorpion.crimea.ua)
Received: (from uucp@localhost)
	by sonet.crimea.ua (8.8.8/8.8.8) with UUCP id UAA18912
	for FreeBSD-gnats-submit@freebsd.org; Sun, 29 Aug 1999 20:23:15 +0400 (MSD)
	(envelope-from phantom@scorpion.crimea.ua)
Received: (from phantom@localhost)
	by scorpion.crimea.ua (8.8.8/8.8.5+ssl+keepalive) id UAA02421;
	Sun, 29 Aug 1999 20:15:09 +0400 (MSD)
Message-Id: <199908291615.UAA02421@scorpion.crimea.ua>
Date: Sun, 29 Aug 1999 20:15:09 +0400 (MSD)
From: "Alexey Zelkin" <phantom@cris.net>
Sender: phantom@scorpion.crimea.ua
Reply-To: "Alexey Zelkin" <phantom@cris.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [PATCH] makewhatis(1) is confuisng with ``-'' symbol in ".Nd" field
X-Send-Pr-Version: 3.2

>Number:         13456
>Category:       bin
>Synopsis:       makewhatis(1) is confuisng with ``-'' symbol in ".Nd" field
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    phantom
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 29 10:30:01 PDT 1999
>Closed-Date:    Sun Sep 5 22:42:59 PDT 1999
>Last-Modified:  Sun Sep  5 22:44:31 PDT 1999
>Originator:     Alexey Zelkin
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
Home
>Environment:

-current, last cvsuped this night

>Description:

If ``-'' symbol present in .Nd (name description) field then makewhatis(1)
thinks that ``-'' present at begining of .Nd line. This caused following
strings in "whatis" database file:

BUS_READ_IVAR(9)	- BUS_WRITE_IVAR manipulate bus-specific device instance variables
cx(4)			- if_cx aynchronous/synhronous Cronyx-Sigma adapter driver

but it should look like

BUS_READ_IVAR(9), BUS_WRITE_IVAR(9) - manipulate bus-specific device instance variables
cx(4), if_cx(4)		- aynchronous/synhronous Cronyx-Sigma adapter driver

>How-To-Repeat:

Use "apropos" or "man -k" for example:

cx(4)
draw_shadow(3)
fabs(3)
isinf(3)

etc. etc. etc.

Test case:

$ mv /usr/share/man/whatis /usr/share/man/whatis.b
$ patch < makewhatis.perl.patch
$ /usr/bin/makewhatis /usr/share/man
$ diff /usr/share/man/whatis.b /usr/share/man/whatis | less

>Fix:
	
Fix is very simple. Original version has check for existence of the dash
(``-'') in description string. Now it checks for existence of the dash at
begining of the descritpion string.

Index: makewhatis.perl
===================================================================
RCS file: /usr/local/CVSROOT/src/gnu/usr.bin/man/makewhatis/makewhatis.perl,v
retrieving revision 1.18
diff -c -r1.18 makewhatis.perl
*** makewhatis.perl	1998/08/05 03:44:14	1.18
--- makewhatis.perl	1999/08/29 18:02:51
***************
*** 368,374 ****
  		    $list .= $_;
  		    $list .= ' ';
  		} else {
! 		    $list .= '- ' if (!$flag && !/-/);
  		    $flag++;
  		    s/^\.[A-Z][a-z][ \t]*//;
  		    s/[ \t]+$//;
--- 368,374 ----
  		    $list .= $_;
  		    $list .= ' ';
  		} else {
! 		    $list .= '- ' if (!$flag && !/^- /);
  		    $flag++;
  		    s/^\.[A-Z][a-z][ \t]*//;
  		    s/[ \t]+$//;

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->mpp 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Aug 30 02:44:36 PDT 1999 
Responsible-Changed-Why:  
Mike, does this look alright to you? 
Responsible-Changed-From-To: mpp->phantom 
Responsible-Changed-By: phantom 
Responsible-Changed-When: Fri Sep 3 06:40:29 PDT 1999 
Responsible-Changed-Why:  
I'll go on with this problem. 

Approved by: mpp 
State-Changed-From-To: open->closed 
State-Changed-By: phantom 
State-Changed-When: Sun Sep 5 22:42:59 PDT 1999 
State-Changed-Why:  
Patch commited in -CURRENT and -STABLE. Thanks! 
>Unformatted:
