mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Teach whereis(1) about games.
Approved by: joerg, sheldonh (mentor)
This commit is contained in:
parent
30268a208b
commit
8e4c33e9e7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100608
@ -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. */
|
||||
|
@ -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
|
||||
|
@ -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... */
|
||||
|
Loading…
Reference in New Issue
Block a user