From wscott@ichips.intel.com  Wed Jul  8 11:06:35 1998
Received: from ganymede.or.intel.com (ganymede.or.intel.com [134.134.248.3])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA05520
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 8 Jul 1998 11:06:34 -0700 (PDT)
          (envelope-from wscott@ichips.intel.com)
Received: from ichips-jf.jf.intel.com (ichips-jf.jf.intel.com [134.134.50.200])
	by ganymede.or.intel.com (8.8.6/8.8.5) with ESMTP id SAA06038
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 8 Jul 1998 18:06:33 GMT
Received: from pdxlx008.pdx.intel.com (pdxlx008.pdx.intel.com [137.102.206.194])
	by ichips-jf.jf.intel.com (8.8.8/8.8.7) with ESMTP id LAA23845
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 8 Jul 1998 11:06:32 -0700 (PDT)
Received: (from wscott@localhost)
	by pdxlx008.pdx.intel.com (8.8.7/8.8.7) id LAA14294;
	Wed, 8 Jul 1998 11:06:27 -0700 (PDT)
	(envelope-from wscott)
Message-Id: <199807081806.LAA14294@pdxlx008.pdx.intel.com>
Date: Wed, 8 Jul 1998 11:06:27 -0700 (PDT)
From: Wayne Scott <wscott@ichips.intel.com>
Reply-To: wscott@ichips.intel.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: 'man' program auto MANPATH enchancement
X-Send-Pr-Version: 3.2

>Number:         7215
>Category:       misc
>Synopsis:       [MFC] 'man' program auth MANPATH needs help
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul  8 11:10:00 PDT 1998
>Closed-Date:    Tue Aug 4 06:47:49 PDT 1998
>Last-Modified:  Tue Aug  4 06:48:26 PDT 1998
>Originator:     Wayne Scott
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
Intel Corp., Hillsboro, Oregon
>Environment:

	

>Description:

	The 'man' program has a feature that it will automaticly determine
	the users MANPATH by looking at the PATH.

	Foreach dir in path it will look for a 'man' or 'MAN' subdirectory.
	Who puts their man directory inside their bin directory???

	I extended the program to add:
		If a directory on the path ends in '/bin' then, replace the
	 	'/bin' with '/man' and add to MANPATH if that directory exists.

	This make much more sense to me.

>How-To-Repeat:

	

>Fix:
	

Index: manpath/manpath.c
===================================================================
RCS file: /home/ncvs/src/gnu/usr.bin/man/manpath/manpath.c,v
retrieving revision 1.5
diff -u -r1.5 manpath.c
--- manpath.c   1997/11/30 19:55:16     1.5
+++ manpath.c   1998/07/08 17:57:07
@@ -122,6 +122,9 @@
  * If so, add that directory to the path.  Example:  user has
  * $HOME/bin in his path and the directory $HOME/bin/man exists -- the
  * directory $HOME/bin/man will be added to the manpath.
+ *
+ * Also search for a `man' directory next to the directory on the path.
+ * Example: $HOME/bin will look for $HOME/man
  */
 char *
 manpath (perrs)
@@ -521,5 +524,13 @@
   if (is_directory (t) == 1)
     return t;
 
+  /* If the path ends in `bin' then replace with `man' and see if that works. */
+  if (len > 3 && strncmp(t+len-4, "/bin", 4) == 0) {
+    strcpy(t+len-4, "/man");
+
+    if (is_directory(t) == 1) 
+       return t;
+  }
+
   return NULL;
 }

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: phk 
State-Changed-When: Wed Jul 8 23:34:24 PDT 1998 
State-Changed-Why:  
awaiting committer 


Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: phk 
Responsible-Changed-When: Wed Jul 8 23:34:24 PDT 1998 
Responsible-Changed-Why:  

Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Thu Jul 9 05:39:14 PDT 1998 
Responsible-Changed-Why:  
So I'll remember to MFC. 
State-Changed-From-To: suspended->closed 
State-Changed-By: des 
State-Changed-When: Tue Aug 4 06:47:49 PDT 1998 
State-Changed-Why:  
MFCed. 
>Unformatted:
