Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/minoura-xpg4dl]: src/usr.sbin Sync w/ netbsd-1-5-base.
details: https://anonhg.NetBSD.org/src/rev/c5cc8efe04a1
branches: minoura-xpg4dl
changeset: 486691:c5cc8efe04a1
user: minoura <minoura%NetBSD.org@localhost>
date: Thu Jun 22 18:00:41 2000 +0000
description:
Sync w/ netbsd-1-5-base.
diffstat:
usr.sbin/Makefile | 15 +-
usr.sbin/ac/ac.8 | 2 +-
usr.sbin/ac/ac.c | 38 +-
usr.sbin/accton/accton.8 | 36 +-
usr.sbin/catman/catman.c | 111 +-
usr.sbin/config/files.c | 17 +-
usr.sbin/dhcp/client/Makefile | 2 +-
usr.sbin/dhcp/client/clparse.c | 68 +-
usr.sbin/dhcp/client/dhclient.8 | 15 +
usr.sbin/dhcp/client/dhclient.c | 264 ++-
usr.sbin/dhcp/client/omapi.c | 328 ---
usr.sbin/dhcp/client/scripts/bsdos | 12 +-
usr.sbin/dhcp/client/scripts/freebsd | 8 +-
usr.sbin/dhcp/client/scripts/linux | 4 +-
usr.sbin/dhcp/client/scripts/netbsd | 5 +-
usr.sbin/dhcp/client/scripts/nextstep | 15 +-
usr.sbin/dhcp/client/scripts/openbsd | 12 +-
usr.sbin/dhcp/client/scripts/solaris | 9 +
usr.sbin/dhcp/common/Makefile | 2 +-
usr.sbin/dhcp/common/alloc.c | 301 +--
usr.sbin/dhcp/common/auth.c | 72 -
usr.sbin/dhcp/common/bpf.c | 18 +-
usr.sbin/dhcp/common/comapi.c | 1015 ++++++++++++
usr.sbin/dhcp/common/conflex.c | 60 +-
usr.sbin/dhcp/common/discover.c | 238 +-
usr.sbin/dhcp/common/dispatch.c | 22 +-
usr.sbin/dhcp/common/dlpi.c | 10 +-
usr.sbin/dhcp/common/dns.c | 136 +-
usr.sbin/dhcp/common/execute.c | 4 +-
usr.sbin/dhcp/common/fddi.c | 16 +-
usr.sbin/dhcp/common/hash.c | 66 +-
usr.sbin/dhcp/common/icmp.c | 5 +-
usr.sbin/dhcp/common/lpf.c | 10 +-
usr.sbin/dhcp/common/memory.c | 137 +-
usr.sbin/dhcp/common/nit.c | 10 +-
usr.sbin/dhcp/common/options.c | 9 +-
usr.sbin/dhcp/common/packet.c | 6 +-
usr.sbin/dhcp/common/parse.c | 38 +-
usr.sbin/dhcp/common/socket.c | 4 +-
usr.sbin/dhcp/common/tables.c | 26 +-
usr.sbin/dhcp/common/tree.c | 6 +-
usr.sbin/dhcp/common/upf.c | 10 +-
usr.sbin/dhcp/dhcpctl/dhcpctl.c | 8 +-
usr.sbin/dhcp/dhcpctl/dhcpctl.h | 7 +-
usr.sbin/dhcp/includes/cf/netbsd.h | 3 +
usr.sbin/dhcp/includes/dhcpd.h | 455 ++++-
usr.sbin/dhcp/includes/dhctoken.h | 27 +-
usr.sbin/dhcp/includes/failover.h | 55 +-
usr.sbin/dhcp/includes/hash.h | 59 +-
usr.sbin/dhcp/includes/minires/minires.h | 7 +-
usr.sbin/dhcp/includes/omapip/omapip.h | 92 +-
usr.sbin/dhcp/includes/omapip/omapip_p.h | 39 +-
usr.sbin/dhcp/includes/site.h | 6 +-
usr.sbin/dhcp/includes/version.h | 2 +-
usr.sbin/dhcp/minires/res_findzonecut.c | 8 +-
usr.sbin/dhcp/minires/res_update.c | 22 +-
usr.sbin/dhcp/omapip/alloc.c | 118 +
usr.sbin/dhcp/omapip/connection.c | 291 ++-
usr.sbin/dhcp/omapip/dispatch.c | 158 +-
usr.sbin/dhcp/omapip/generic.c | 16 +-
usr.sbin/dhcp/omapip/listener.c | 95 +-
usr.sbin/dhcp/omapip/message.c | 3 +
usr.sbin/dhcp/omapip/protocol.c | 143 +-
usr.sbin/dhcp/omapip/support.c | 70 +-
usr.sbin/dhcp/omapip/test.c | 1 +
usr.sbin/dhcp/relay/dhcrelay.c | 17 +-
usr.sbin/dhcp/server/Makefile | 2 +-
usr.sbin/dhcp/server/bootp.c | 83 +-
usr.sbin/dhcp/server/class.c | 41 +-
usr.sbin/dhcp/server/confpars.c | 1029 ++++++++---
usr.sbin/dhcp/server/db.c | 157 +-
usr.sbin/dhcp/server/dhcp.c | 924 +++++++---
usr.sbin/dhcp/server/dhcpd.c | 216 ++-
usr.sbin/dhcp/server/dhcpd.conf.5 | 23 +-
usr.sbin/dhcp/server/failover.c | 2477 +++++++++++++++++++++++++++--
usr.sbin/dhcp/server/mdb.c | 1649 +++++++++++--------
usr.sbin/dhcp/server/omapi.c | 783 +++-----
usr.sbin/dhcp/server/salloc.c | 131 +
usr.sbin/dhcp/server/stables.c | 43 +-
usr.sbin/dumplfs/dumplfs.8 | 29 +-
usr.sbin/dumplfs/dumplfs.c | 132 +-
usr.sbin/faithd/README | 8 +-
usr.sbin/faithd/faithd.8 | 76 +-
usr.sbin/faithd/faithd.c | 17 +-
usr.sbin/faithd/faithd.h | 7 +-
usr.sbin/faithd/ftp.c | 17 +-
usr.sbin/faithd/rsh.c | 7 +-
usr.sbin/faithd/tcp.c | 7 +-
usr.sbin/inetd/inetd.8 | 93 +-
usr.sbin/inetd/inetd.c | 68 +-
usr.sbin/iostat/iostat.c | 7 +-
usr.sbin/ipf/ipftest/Makefile | 5 +-
usr.sbin/ipf/ipftest/test/Makefile | 16 +-
usr.sbin/ipf/ipftest/test/dotest | 10 +-
usr.sbin/ipf/ipftest/test/hextest | 10 +-
usr.sbin/ipf/ipftest/test/itest | 8 +-
usr.sbin/ipf/ipftest/test/nattest | 10 +-
usr.sbin/iteconfig/pathnames.h | 16 +-
usr.sbin/kadmin/Makefile | 54 +
usr.sbin/kstash/Makefile | 31 +
usr.sbin/ktutil/Makefile | 42 +
usr.sbin/kvm_mkdb/extern.h | 2 +-
usr.sbin/kvm_mkdb/kvm_mkdb.c | 4 +-
usr.sbin/kvm_mkdb/nlist.c | 4 +-
usr.sbin/kvm_mkdb/nlist_aout.c | 4 +-
usr.sbin/kvm_mkdb/nlist_coff.c | 20 +-
usr.sbin/kvm_mkdb/nlist_ecoff.c | 20 +-
usr.sbin/kvm_mkdb/nlist_elf32.c | 20 +-
usr.sbin/kvm_mkdb/nlist_elf64.c | 20 +-
usr.sbin/lpr/lpd/Makefile | 12 +-
usr.sbin/mdsetimage/exec_aout.c | 20 +-
usr.sbin/mdsetimage/exec_coff.c | 20 +-
usr.sbin/mdsetimage/exec_ecoff.c | 20 +-
usr.sbin/mdsetimage/exec_elf32.c | 20 +-
usr.sbin/mdsetimage/exec_elf64.c | 20 +-
usr.sbin/mdsetimage/extern.h | 18 +-
usr.sbin/mdsetimage/mdsetimage.8 | 18 +-
usr.sbin/mdsetimage/mdsetimage.c | 20 +-
usr.sbin/mountd/exports.5 | 28 +-
usr.sbin/mountd/mountd.8 | 2 +-
usr.sbin/mountd/mountd.c | 749 ++++++--
usr.sbin/nfsd/nfsd.8 | 7 +-
usr.sbin/nfsd/nfsd.c | 261 ++-
usr.sbin/ntp/Makefile.inc | 10 +-
usr.sbin/ntp/ntpd/Makefile | 8 +-
usr.sbin/ntp/ntpdate/Makefile | 8 +-
usr.sbin/ntp/ntpdc/Makefile | 6 -
usr.sbin/ntp/ntpq/Makefile | 8 +-
usr.sbin/ntp/ntptime/Makefile | 7 +-
usr.sbin/ntp/ntptimeset/Makefile | 7 +-
usr.sbin/ntp/ntptrace/Makefile | 8 +-
usr.sbin/pkg_install/add/add.h | 4 +-
usr.sbin/pkg_install/add/extract.c | 13 +-
usr.sbin/pkg_install/add/main.c | 10 +-
usr.sbin/pkg_install/add/perform.c | 9 +-
usr.sbin/pkg_install/delete/main.c | 11 +-
usr.sbin/pkg_install/info/main.c | 13 +-
usr.sbin/pkg_install/lib/ftpio.c | 29 +-
usr.sbin/pkg_install/lib/pkgdb.c | 8 +-
usr.sbin/pkg_install/lib/str.c | 40 +-
usr.sbin/portmap/Makefile | 11 -
usr.sbin/portmap/portmap.8 | 152 -
usr.sbin/portmap/portmap.c | 779 ---------
usr.sbin/pstat/pstat.8 | 50 +-
usr.sbin/pstat/pstat.c | 27 +-
usr.sbin/rpc.bootparamd/Makefile | 16 +-
usr.sbin/rpc.bootparamd/bootparamd.c | 11 +-
usr.sbin/rpc.lockd/Makefile | 18 +-
usr.sbin/rpc.lockd/lock_proc.c | 333 ++-
usr.sbin/rpc.lockd/lockd.c | 181 +-
usr.sbin/rpc.lockd/lockd.h | 4 +-
usr.sbin/rpc.lockd/lockd_lock.c | 756 +++++++++
usr.sbin/rpc.lockd/lockd_lock.h | 20 +
usr.sbin/rpc.lockd/rpc.lockd.8 | 16 +-
usr.sbin/rpc.statd/Makefile | 16 +-
usr.sbin/rpc.statd/stat_proc.c | 21 +-
usr.sbin/rpc.statd/statd.c | 82 +-
usr.sbin/rpcbind/Makefile | 20 +
usr.sbin/rpcbind/check_bound.c | 222 ++
usr.sbin/rpcbind/pmap_svc.c | 365 ++++
usr.sbin/rpcbind/rpcb_stat.c | 205 ++
usr.sbin/rpcbind/rpcb_svc.c | 232 ++
usr.sbin/rpcbind/rpcb_svc_4.c | 451 +++++
usr.sbin/rpcbind/rpcb_svc_com.c | 1448 +++++++++++++++++
usr.sbin/rpcbind/rpcbind.8 | 109 +
usr.sbin/rpcbind/rpcbind.c | 565 ++++++
usr.sbin/rpcbind/rpcbind.h | 143 +
usr.sbin/rpcbind/security.c | 278 +++
usr.sbin/rpcbind/util.c | 349 ++++
usr.sbin/rpcbind/warmstart.c | 177 ++
usr.sbin/sa/extern.h | 16 +-
usr.sbin/sa/main.c | 16 +-
usr.sbin/sa/pathnames.h | 16 +-
usr.sbin/sa/pdb.c | 16 +-
usr.sbin/sa/sa.8 | 15 +-
usr.sbin/sa/usrdb.c | 16 +-
usr.sbin/setkey/Makefile | 34 -
usr.sbin/setkey/parse.y | 791 ---------
usr.sbin/setkey/sample.cf | 219 --
usr.sbin/setkey/scriptdump.pl | 58 -
usr.sbin/setkey/setkey.8 | 562 ------
usr.sbin/setkey/setkey.c | 582 -------
usr.sbin/setkey/test-pfkey.c | 510 ------
usr.sbin/setkey/test-policy.c | 160 -
usr.sbin/setkey/token.l | 324 ---
usr.sbin/setkey/vchar.h | 35 -
usr.sbin/tcpdump/print-llc.c | 6 +-
usr.sbin/tcpdump/print-nfs.c | 516 +++--
usr.sbin/tcpdump/print-sunrpc.c | 59 +-
usr.sbin/traceroute/traceroute.8 | 21 +-
usr.sbin/traceroute6/traceroute6.8 | 48 +-
usr.sbin/traceroute6/traceroute6.c | 241 +-
usr.sbin/ypserv/yppush/yppush.c | 4 +-
193 files changed, 16594 insertions(+), 9348 deletions(-)
diffs (truncated from 36323 to 300 lines):
diff -r 441b206de05b -r c5cc8efe04a1 usr.sbin/Makefile
--- a/usr.sbin/Makefile Thu Jun 22 16:58:08 2000 +0000
+++ b/usr.sbin/Makefile Thu Jun 22 18:00:41 2000 +0000
@@ -1,9 +1,6 @@
-# $NetBSD: Makefile,v 1.141 2000/05/02 12:14:40 simonb Exp $
+# $NetBSD: Makefile,v 1.141.2.1 2000/06/22 18:00:41 minoura Exp $
# from: @(#)Makefile 5.20 (Berkeley) 6/12/93
-SRCTOP= ..
-.include <bsd.crypto.mk>
-
SUBDIR= ac accton amd apm apmd arp bad144 bind bootp catman \
chown chroot chrtbl cnwctl config cron dbsym dev_mkdb \
dhcp diskpart dumpfs dumplfs edquota eeprom \
@@ -12,10 +9,10 @@
kvm_mkdb lastlogin link lpr mailwrapper map-mbone \
mdconfig mdsetimage \
memswitch mopd mountd mrinfo mrouted mtrace mtree \
- netgroup_mkdb nfsd ntp pkg_install portmap pppd pstat \
+ netgroup_mkdb nfsd ntp pkg_install pppd pstat \
pwd_mkdb quot quotacheck quotaon rarpd rbootd rdate \
repquota rmt rpc.bootparamd rpc.lockd rpc.pcnfsd \
- rpc.statd rpc.yppasswdd rwhod sa screenblank sesd \
+ rpc.statd rpc.yppasswdd rpcbind rwhod sa screenblank sesd \
sliplogin slstats spray sup syslogd tadpolectl tcpdchk \
tcpdmatch tcpdump timed traceroute trpt trsp unlink \
usbdevs user videomode vipw vnconfig wiconfig wsconscfg \
@@ -23,13 +20,11 @@
# IPv6
SUBDIR+=faithd gifconfig ifmcstat mld6query mtrace6 ndp pim6dd pim6sd \
- rip6query route6d rtadvd setkey traceroute6 rtsold
+ rip6query route6d rtadvd traceroute6 rtsold
# ATM PVC
SUBDIR+=pvcsif pvctxctl
-.if defined(CRYPTOPATH)
-.sinclude "${CRYPTOPATH}/usr.sbin/Makefile.frag"
-.endif
+SUBDIR+= kadmin kstash ktutil
.include <bsd.subdir.mk>
diff -r 441b206de05b -r c5cc8efe04a1 usr.sbin/ac/ac.8
--- a/usr.sbin/ac/ac.8 Thu Jun 22 16:58:08 2000 +0000
+++ b/usr.sbin/ac/ac.8 Thu Jun 22 18:00:41 2000 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: ac.8,v 1.7 1999/03/22 18:43:46 garbled Exp $
+.\" $NetBSD: ac.8,v 1.7.8.1 2000/06/22 18:00:42 minoura Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
diff -r 441b206de05b -r c5cc8efe04a1 usr.sbin/ac/ac.c
--- a/usr.sbin/ac/ac.c Thu Jun 22 16:58:08 2000 +0000
+++ b/usr.sbin/ac/ac.c Thu Jun 22 18:00:41 2000 +0000
@@ -1,7 +1,39 @@
-/* $NetBSD: ac.c,v 1.9 1999/10/11 11:44:59 mrg Exp $ */
+/* $NetBSD: ac.c,v 1.9.4.1 2000/06/22 18:00:42 minoura Exp $ */
/*
- * Copyright (c) 1994 Christopher G. Demetriou.
+ * Copyright (c) 1994 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed for the
+ * NetBSD Project. See http://www.netbsd.org/ for
+ * information about NetBSD.
+ * 4. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
+ *
+ *
* @(#)Copyright (c) 1994, Simon J. Gerraty.
*
* This is free software. It comes with NO WARRANTY.
@@ -17,7 +49,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: ac.c,v 1.9 1999/10/11 11:44:59 mrg Exp $");
+__RCSID("$NetBSD: ac.c,v 1.9.4.1 2000/06/22 18:00:42 minoura Exp $");
#endif
#include <sys/types.h>
diff -r 441b206de05b -r c5cc8efe04a1 usr.sbin/accton/accton.8
--- a/usr.sbin/accton/accton.8 Thu Jun 22 16:58:08 2000 +0000
+++ b/usr.sbin/accton/accton.8 Thu Jun 22 18:00:41 2000 +0000
@@ -1,6 +1,8 @@
+.\" $NetBSD: accton.8,v 1.6.8.1 2000/06/22 18:00:42 minoura Exp $
+.\"
.\" Copyright (c) 1993 Christopher G. Demetriou
.\" All rights reserved.
-.\"
+.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -9,22 +11,26 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. The name of the author may not be used to endorse or promote products
+.\" 3. All advertising materials mentioning features or use of this software
+.\" must display the following acknowledgement:
+.\" This product includes software developed for the
+.\" NetBSD Project. See http://www.netbsd.org/ for
+.\" information about NetBSD.
+.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
-.\"
+.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
-.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-.\" POSSIBILITY OF SUCH DAMAGE.
-.\"
-.\" $NetBSD: accton.8,v 1.6 1999/03/22 18:43:46 garbled Exp $
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
.\"
.Dd October 18, 1993
.Dt ACCTON 8
diff -r 441b206de05b -r c5cc8efe04a1 usr.sbin/catman/catman.c
--- a/usr.sbin/catman/catman.c Thu Jun 22 16:58:08 2000 +0000
+++ b/usr.sbin/catman/catman.c Thu Jun 22 18:00:41 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: catman.c,v 1.14 2000/01/09 04:54:54 tsutsui Exp $ */
+/* $NetBSD: catman.c,v 1.14.2.1 2000/06/22 18:00:42 minoura Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,8 +65,10 @@
int f_noprint = 0;
int dowhatis = 0;
-int main __P((int, char **));
-static void setdefentries __P((char *, char *, char *));
+TAG *defp; /* pointer to _default list */
+
+int main __P((int, char * const *));
+static void setdefentries __P((char *, char *, const char *));
static void uniquepath __P((void));
static void catman __P((void));
static void scanmandir __P((const char *, const char *));
@@ -82,7 +84,7 @@
int
main(argc, argv)
int argc;
- char **argv;
+ char * const *argv;
{
char *m_path = NULL;
char *m_add = NULL;
@@ -128,7 +130,7 @@
usage();
config(_PATH_MANCONF);
- setdefentries(m_path, m_add, (argc == 0)? NULL : argv[argc-1]);
+ setdefentries(m_path, m_add, (argc == 0) ? NULL : argv[argc-1]);
uniquepath();
if (f_noformat == 0 || f_nowhatis == 0)
@@ -143,12 +145,12 @@
setdefentries(m_path, m_add, sections)
char *m_path;
char *m_add;
- char *sections;
+ const char *sections;
{
- TAG *defp, *defnewp, *sectnewp, *subp;
- ENTRY *e_defp, *e_sectp, *e_subp, *ep;
- char *p, *slashp, *machine;
- char section[10];
+ TAG *defnewp, *sectnewp, *subp;
+ ENTRY *e_defp, *e_subp;
+ const char *p;
+ char *slashp, *machine;
char buf[MAXPATHLEN * 2];
int i;
@@ -167,25 +169,21 @@
if ((defp = getlist("_default")) == NULL)
defp = addlist("_default");
+ subp = getlist("_subdir");
+
/*
* 0: If one or more sections was specified, rewrite _subdir list.
*/
if (sections != NULL) {
sectnewp = addlist("_section_new");
for(p=sections; *p;) {
- section[0] = *p++;
- for(i=1; *p && !isdigit(*p) && i<10; i++)
- section[i] = *p++;
- section[i] = '\0';
- snprintf(buf, sizeof(buf), "man%s", section);
- if(!(e_sectp = malloc(sizeof(ENTRY))))
- err(1, "malloc");
- if(!(e_sectp->s = strdup(buf)))
- err(1, "malloc");
- TAILQ_INSERT_TAIL(§newp->list, e_sectp, q);
+ i = snprintf(buf, sizeof(buf), "man%c", *p++);
+ for(; *p && !isdigit(*p) && i<sizeof(buf)-1; i++)
+ buf[i] = *p++;
+ buf[i] = '\0';
+ addentry(sectnewp, buf, 0);
}
- removelist("_subdir");
- renamelist("_section_new", "_subdir");
+ subp = sectnewp;
}
/*
@@ -203,17 +201,13 @@
for (p = strtok(m_path, ":");
p != NULL; p = strtok(NULL, ":")) {
slashp = p[strlen(p) - 1] == '/' ? "" : "/";
- e_subp = (subp = getlist("_subdir")) == NULL ?
- NULL : subp->list.tqh_first;
+ e_subp = subp == NULL ? NULL : subp->list.tqh_first;
for (; e_subp != NULL; e_subp = e_subp->q.tqe_next) {
if(!strncmp(e_subp->s, "cat", 3))
continue;
(void)snprintf(buf, sizeof(buf), "%s%s%s{/%s,}",
p, slashp, e_subp->s, machine);
- if ((ep = malloc(sizeof(ENTRY))) == NULL ||
- (ep->s = strdup(buf)) == NULL)
- err(1, "malloc");
- TAILQ_INSERT_TAIL(&defp->list, ep, q);
+ addentry(defp, buf, 0);
}
}
}
@@ -224,27 +218,22 @@
*/
if (m_path == NULL) {
defp = getlist("_default");
- defnewp = addlist("_default_new");
+ defnewp = addlist("_default_new1");
e_defp =
defp->list.tqh_first == NULL ? NULL : defp->list.tqh_first;
for (; e_defp; e_defp = e_defp->q.tqe_next) {
slashp =
e_defp->s[strlen(e_defp->s) - 1] == '/' ? "" : "/";
- e_subp = (subp = getlist("_subdir")) == NULL ?
- NULL : subp->list.tqh_first;
+ e_subp = subp == NULL ? NULL : subp->list.tqh_first;
for (; e_subp; e_subp = e_subp->q.tqe_next) {
if(!strncmp(e_subp->s, "cat", 3))
continue;
(void)snprintf(buf, sizeof(buf), "%s%s%s{/%s,}",
- e_defp->s, slashp, e_subp->s, machine);
- if ((ep = malloc(sizeof(ENTRY))) == NULL ||
- (ep->s = strdup(buf)) == NULL)
- err(1, "malloc");
- TAILQ_INSERT_TAIL(&defnewp->list, ep, q);
+ e_defp->s, slashp, e_subp->s, machine);
+ addentry(defnewp, buf, 0);
}
}
- removelist("_default");
Home |
Main Index |
Thread Index |
Old Index