version 1.1.1.1, 1995/10/18 08:44:52 |
version 1.6, 1997/11/30 05:30:36 |
|
|
|
/* $OpenBSD$ */ |
/* $NetBSD: apropos.c,v 1.5 1995/09/04 20:46:20 tls Exp $ */ |
/* $NetBSD: apropos.c,v 1.5 1995/09/04 20:46:20 tls Exp $ */ |
|
|
/* |
/* |
|
|
#if 0 |
#if 0 |
static char sccsid[] = "@(#)apropos.c 8.8 (Berkeley) 5/4/95"; |
static char sccsid[] = "@(#)apropos.c 8.8 (Berkeley) 5/4/95"; |
#else |
#else |
static char rcsid[] = "$NetBSD: apropos.c,v 1.5 1995/09/04 20:46:20 tls Exp $"; |
static char rcsid[] = "$OpenBSD$"; |
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
|
|
|
static int *found, foundman; |
static int *found, foundman; |
|
|
|
#define MAXLINELEN 8192 /* max line handled */ |
|
|
void apropos __P((char **, char *, int)); |
void apropos __P((char **, char *, int)); |
void lowstr __P((char *, char *)); |
void lowstr __P((char *, char *)); |
int match __P((char *, char *)); |
int match __P((char *, char *)); |
|
|
|
|
conffile = NULL; |
conffile = NULL; |
p_augment = p_path = NULL; |
p_augment = p_path = NULL; |
while ((ch = getopt(argc, argv, "C:M:m:P:")) != EOF) |
while ((ch = getopt(argc, argv, "C:M:m:P:")) != -1) |
switch (ch) { |
switch (ch) { |
case 'C': |
case 'C': |
conffile = optarg; |
conffile = optarg; |
|
|
int buildpath; |
int buildpath; |
{ |
{ |
char *end, *name, **p; |
char *end, *name, **p; |
char buf[LINE_MAX + 1], wbuf[LINE_MAX + 1]; |
char buf[MAXLINELEN + 1], wbuf[MAXLINELEN + 1]; |
|
char hold[MAXPATHLEN]; |
|
|
for (name = path; name; name = end) { /* through name list */ |
for (name = path; name; name = end) { /* through name list */ |
if (end = strchr(name, ':')) |
if ((end = strchr(name, ':'))) |
*end++ = '\0'; |
*end++ = '\0'; |
|
|
if (buildpath) { |
if (buildpath) { |
char hold[MAXPATHLEN + 1]; |
(void)snprintf(hold, sizeof(hold), "%s/%s", name, |
|
_PATH_WHATIS); |
(void)sprintf(hold, "%s/%s", name, _PATH_WHATIS); |
|
name = hold; |
name = hold; |
} |
} |
|
|