summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/man/manpath/manpath.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>1998-07-09 12:39:08 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>1998-07-09 12:39:08 +0000
commitd65fe5d36dffb67c0ce6a376f117fd7f8aa57437 (patch)
tree1711293cc798f9016cd940beb66a3684eed3082c /gnu/usr.bin/man/manpath/manpath.c
parentd59b62e37ba029804fc0aa9b6d0c65ff54ba8eff (diff)
Notes
Diffstat (limited to 'gnu/usr.bin/man/manpath/manpath.c')
-rw-r--r--gnu/usr.bin/man/manpath/manpath.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gnu/usr.bin/man/manpath/manpath.c b/gnu/usr.bin/man/manpath/manpath.c
index c988cd2acc9e..a8c4cbc714dc 100644
--- a/gnu/usr.bin/man/manpath/manpath.c
+++ b/gnu/usr.bin/man/manpath/manpath.c
@@ -122,6 +122,9 @@ usage ()
* If so, add that directory to the path. Example: user has
* $HOME/bin in his path and the directory $HOME/bin/man exists -- the
* directory $HOME/bin/man will be added to the manpath.
+ *
+ * Also search for a `man' directory next to the directory on the path.
+ * Example: $HOME/bin will look for $HOME/man
*/
char *
manpath (perrs)
@@ -521,5 +524,13 @@ has_subdirs (p)
if (is_directory (t) == 1)
return t;
+ /* If the path ends in `bin' then replace with `man' and see if that works. */
+ if (len > 3 && strncmp(t+len-4, "/bin", 4) == 0) {
+ strcpy(t+len-4, "/man");
+
+ if (is_directory(t) == 1)
+ return t;
+ }
+
return NULL;
}