From owner-ports-jp@jp.freebsd.org  Thu Jun  7 10:13:10 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id KAA85940;
	Thu, 7 Jun 2001 10:13:10 +0900 (JST)
	(envelope-from owner-ports-jp@jp.FreeBSD.org)
Received: from shiva.tri.asanuma.co.jp (shiva.tri.asanuma.co.jp [210.160.188.2])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id KAA85900
	for <ports-jp@jp.freebsd.org>; Thu, 7 Jun 2001 10:13:08 +0900 (JST)
	(envelope-from mori@tri.asanuma.co.jp)
Received: from yashoda.tri.asanuma.co.jp (yashoda.tri.asanuma.co.jp [172.16.57.11])
	by shiva.tri.asanuma.co.jp (Postfix) with ESMTP id 6EBA35430
	for <ports-jp@jp.freebsd.org>; Thu,  7 Jun 2001 10:13:06 +0900 (JST)
Received: from kurishna.tri.asanuma.co.jp (kurishna.tri.asanuma.co.jp [172.16.57.2])
	by yashoda.tri.asanuma.co.jp (8.11.0/8.11.0) with ESMTP id f571D5x26002
	for <ports-jp@jp.freebsd.org>; Thu, 7 Jun 2001 10:13:05 +0900 (JST)
To: ports-jp@jp.freebsd.org
Siganture-File: ~/.signature
MIME-Version: 1.0 (generated by REMI 1.14.2 - =?ISO-8859-4?Q?=22Hokuhoku-=D2?=
 =?ISO-8859-4?Q?shima=22?=)
Content-Type: multipart/mixed;
 boundary="Multipart_Thu_Jun__7_10:13:04_2001-1"
From: Mori Kouji <mori@tri.asanuma.co.jp>
Date: 07 Jun 2001 10:13:04 +0900
Message-ID: <80n17lum73.fsf@kurishna.tri.asanuma.co.jp>
Lines: 101
User-Agent: Nana-gnus/7.1.0.23 REMI/1.14.2 (=?ISO-8859-4?Q?Hokuhoku-=D2shi?=
 =?ISO-8859-4?Q?ma?=) Chao/1.14.1 (=?ISO-8859-4?Q?Rokujiz=F2?=) APEL/10.3
 Emacs/21.0.103 (i386--freebsd) MULE/5.0 (SAKAKI)
Reply-To: ports-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: ports-jp 11104
Subject: [ports-jp 11104] jman doesn't search archdir
Errors-To: owner-ports-jp@jp.freebsd.org
Sender: owner-ports-jp@jp.freebsd.org
X-Originator: mori@kurishna.tri.asanuma.co.jp

--Multipart_Thu_Jun__7_10:13:04_2001-1
Content-Type: text/plain; charset=ISO-2022-JP

$B?9$G$9!#(Bfj.os.bsd.freebsd $B$G=P$F$?!"(Bjman $B$@$H(B /usr/share/man/man4/i386 $B$N(B
man $B$rC5$7$F$/$l$J$$OC!#(B <9fl8a0$lq0$1@henry.hirata.nuee.nagoya-u.ac.jp>

FreeBSD 4.3-RELEASE $B$G(B MFC $B$5$l$?(B architecture specific directory $B$r(B
$BC5$95!G=$,(B ja-man-1.1i $B$KF~$C$F$$$J$$$N$,D>@\$N860x$G$9!#(B
  http://www.freebsd.org/cgi-bin/cvsweb.cgi/src/gnu/usr.bin/man/man/man.c#rev1.37.2.2

$B$G!"$=$NItJ,$@$1(B MFC $B$9$k(B patch $B$r:n$C$?$N$G$3$C$A$K$bN.$7$^$9!#(B
$B5^$0?M(B($B$$$k$N$+(B?)$B$O$I$&$>!#(B


--Multipart_Thu_Jun__7_10:13:04_2001-1
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: attachment; filename="patch-machine"
Content-Transfer-Encoding: 7bit

--- man/man.c	Mon Jan 15 18:52:53 2001
+++ man/man.c	Thu Jun  7 09:48:32 2001
@@ -23,7 +23,7 @@
 
 #include <sys/file.h>
 #include <sys/stat.h>
-#include <sys/types.h>
+#include <sys/param.h>
 #include <ctype.h>
 #include <errno.h>
 #ifdef __FreeBSD__
@@ -74,6 +74,7 @@
 
 char *prognam;
 static char *pager;
+static char *machine;
 static char *manp;
 static char *manpathlist[MAXDIRS];
 static char *section;
@@ -513,6 +514,12 @@
   if (debug)
     fprintf (stderr, "\nusing %s as pager\n", pager);
 
+  if ((machine = getenv ("MACHINE")) == NULL)
+    machine = MACHINE;
+
+  if (debug)
+    fprintf (stderr, "\nusing %s architecture\n", machine);
+
   if (manp == NULL)
     {
       if ((manp = manpath (0)) == NULL)
@@ -701,6 +708,15 @@
       *t1 = '\0';
       t2 = strrchr (to_name, '/');
       *t1 = '/';
+
+      /* Skip architecture part (if present). */
+      if (t2 != NULL && (t1 - t2 < 5 || *(t2 + 1) != 'm' || *(t2 + 3) != 'n'))
+	{
+	 t1 = t2;
+	 *t1 = '\0';
+	 t2 = strrchr (to_name, '/');
+	 *t1 = '/';
+	}
     }
 
   if (t2 == NULL)
@@ -1509,6 +1525,22 @@
   register int cat;
   register char **names;
   register char **np;
+  static int arch_search;
+  char buf[FILENAME_MAX];
+
+  if (!arch_search)
+   {
+    snprintf(buf, sizeof(buf), "%s/man%s/%s", path, section, machine);
+     if (is_directory (buf) == 1)
+      {
+        snprintf(buf, sizeof(buf), "%s/%s", machine, name);
+        arch_search++;
+        found = try_section (path, section, buf, glob);
+        arch_search--;
+        if (found && !findall)   /* only do this architecture... */
+          return found;
+      }
+   }
 
   if (debug)
     {

--Multipart_Thu_Jun__7_10:13:04_2001-1
Content-Type: text/plain; charset=ISO-2022-JP


-- 
$B?9(B $B9@Fs(B	(MORI Kouji)
($B3t(B)$B^I>BAH(B $B5;=Q8&5f=j(B
E-mail: mori@tri.asanuma.co.jp

--Multipart_Thu_Jun__7_10:13:04_2001-1--
