summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjohan <johan@FreeBSD.org>2002-07-24 14:35:29 +0000
committerjohan <johan@FreeBSD.org>2002-07-24 14:35:29 +0000
commit544f1a7f941301724f291cb2b61a92eff0d0157e (patch)
tree34249a3f7075e652103870d19a3c5ac168f63a11 /usr.bin
parent2fe187e9c495a09496907a116fda837f56f28624 (diff)
downloadFreeBSD-src-544f1a7f941301724f291cb2b61a92eff0d0157e.zip
FreeBSD-src-544f1a7f941301724f291cb2b61a92eff0d0157e.tar.gz
Teach whereis(1) about games.
Approved by: joerg, sheldonh (mentor)
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/whereis/pathnames.h5
-rw-r--r--usr.bin/whereis/whereis.13
-rw-r--r--usr.bin/whereis/whereis.c6
3 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/whereis/pathnames.h b/usr.bin/whereis/pathnames.h
index 2ffe2f1..569c72e 100644
--- a/usr.bin/whereis/pathnames.h
+++ b/usr.bin/whereis/pathnames.h
@@ -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. */
diff --git a/usr.bin/whereis/whereis.1 b/usr.bin/whereis/whereis.1
index c8257dd..12b9b98 100644
--- a/usr.bin/whereis/whereis.1
+++ b/usr.bin/whereis/whereis.1
@@ -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
diff --git a/usr.bin/whereis/whereis.c b/usr.bin/whereis/whereis.c
index 84584b2..b2a79d2 100644
--- a/usr.bin/whereis/whereis.c
+++ b/usr.bin/whereis/whereis.c
@@ -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... */
OpenPOWER on IntegriCloud