From 4e14b2a8e2dbe1987586468cb0c79313d0af08cd Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 19 Mar 2018 10:30:40 +0000 Subject: man: search for man pages relative to the executable Add a 'man' directory in the same directory as the current BusyBox executable to the end of the list of paths searched for man pages. See GitHub issue #102. --- miscutils/man.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/miscutils/man.c b/miscutils/man.c index 6f74b5aaa..567323a88 100644 --- a/miscutils/man.c +++ b/miscutils/man.c @@ -314,6 +314,16 @@ int man_main(int argc UNUSED_PARAM, char **argv) } config_close(parser); +#if ENABLE_PLATFORM_MINGW32 + { + char *exepath = xstrdup(bb_busybox_exec_path); + char *relpath = concat_path_file(dirname(exepath), "man"); + man_path_list = add_MANPATH(man_path_list, &count_mp, relpath); + free(relpath); + free(exepath); + } +#endif + { /* environment overrides setting from man.config */ char *env_pager = getenv("MANPAGER"); -- cgit v1.2.3-55-g6feb