Teach whereis(1) about games.

Approved by:	joerg, sheldonh (mentor)
This commit is contained in:
johan 2002-07-24 14:35:29 +00:00
parent 2fe187e9c4
commit 544f1a7f94
3 changed files with 9 additions and 5 deletions

View File

@ -34,7 +34,8 @@
"/usr/src/gnu/libexec:/usr/src/contrib:" \
"/usr/src/secure/bin:/usr/src/secure/usr.bin:" \
"/usr/src/secure/sbin:/usr/src/secure/usr.sbin:" \
"/usr/src/secure/libexec:/usr/src/crypto"
"/usr/src/secure/libexec:/usr/src/crypto:" \
"/usr/src/games"
/* Each subdirectory of PATH_PORTS will be appended to PATH_SOURCES. */
#define PATH_PORTS "/usr/ports"
@ -43,7 +44,7 @@
#define MANPATHCMD "manpath -q"
/* How to obtain the location of manpages, and how to match this result. */
#define MANWHEREISCMD "man -S1:8 -w %s 2>/dev/null"
#define MANWHEREISCMD "man -S1:8:6 -w %s 2>/dev/null"
#define MANWHEREISMATCH "^.* [(]source: (.*)[)]$"
/* Command used to locate sources that have not been found yet. */

View File

@ -68,7 +68,8 @@ The default path searched is the string returned by the
utility for the
.Dq user.cs_path
string, with
.Pa /usr/libexec
.Pa /usr/libexec ,
.Pa /usr/games
and the current user's
.Ev $PATH
appended. Manual pages are searched by default along the

View File

@ -259,7 +259,8 @@ defaults(void)
if (!opt_b && !opt_m && !opt_s)
opt_b = opt_m = opt_s = 1;
/* -b defaults to default path + /usr/libexec + user's path */
/* -b defaults to default path + /usr/libexec +
* /usr/games + user's path */
if (!bindirs) {
if (sysctlbyname("user.cs_path", (void *)NULL, &s,
(void *)NULL, 0) == -1)
@ -270,10 +271,11 @@ defaults(void)
err(EX_OSERR, "sysctlbyname(\"user.cs_path\")");
nele = 0;
decolonify(b, &bindirs, &nele);
bindirs = realloc(bindirs, (nele + 2) * sizeof(char *));
bindirs = realloc(bindirs, (nele + 3) * sizeof(char *));
if (bindirs == NULL)
abort();
bindirs[nele++] = "/usr/libexec";
bindirs[nele++] = "/usr/games";
bindirs[nele] = NULL;
if ((cp = getenv("PATH")) != NULL) {
/* don't destroy the original environment... */