From 1716a6b1dd9ed9e5dc3b026f1eba9c439d319a53 Mon Sep 17 00:00:00 2001 From: des Date: Thu, 9 Jul 1998 12:39:08 +0000 Subject: For every directory in ${PATH} that ends with "/bin", look for a corresponding directory ending in "/man". PR: 7215 Submitted by: Wayne Scott --- gnu/usr.bin/man/manpath/manpath.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gnu/usr.bin/man/manpath/manpath.c') 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; } -- cgit v1.1