diff options
author | des <des@FreeBSD.org> | 1998-07-09 12:39:08 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 1998-07-09 12:39:08 +0000 |
commit | 1716a6b1dd9ed9e5dc3b026f1eba9c439d319a53 (patch) | |
tree | 07a6deddedf6dbad4bd469fc84a937920848261c /gnu/usr.bin/man | |
parent | 2d02bdedf240c49617d271023550a7e9d3c98c39 (diff) | |
download | FreeBSD-src-1716a6b1dd9ed9e5dc3b026f1eba9c439d319a53.zip FreeBSD-src-1716a6b1dd9ed9e5dc3b026f1eba9c439d319a53.tar.gz |
For every directory in ${PATH} that ends with "/bin", look for a
corresponding directory ending in "/man".
PR: 7215
Submitted by: Wayne Scott <wscott@ichips.intel.com>
Diffstat (limited to 'gnu/usr.bin/man')
-rw-r--r-- | gnu/usr.bin/man/manpath/manpath.c | 11 |
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 c988cd2ac..a8c4cbc 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; } |