summaryrefslogtreecommitdiff
path: root/miscutils/man.c
diff options
context:
space:
mode:
authorDenis Vlasenko2008-09-14 21:30:35 +0000
committerDenis Vlasenko2008-09-14 21:30:35 +0000
commita1e16c9298756e54161d9bf7d24b03415e2707c0 (patch)
treec74cfdeb08ad7fe930e21306e8c4a7066bb84b42 /miscutils/man.c
parente357d2ae6833e3ca306f3aa6e12c6ddf2ff1eae2 (diff)
downloadbusybox-a1e16c9298756e54161d9bf7d24b03415e2707c0.zip
busybox-a1e16c9298756e54161d9bf7d24b03415e2707c0.tar.gz
man: do not use default if /etc/man.conf has different MANPATH
do not warn if /etc/man.conf does not exist
Diffstat (limited to 'miscutils/man.c')
-rw-r--r--miscutils/man.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/miscutils/man.c b/miscutils/man.c
index 26fd44d..24551c0 100644
--- a/miscutils/man.c
+++ b/miscutils/man.c
@@ -168,11 +168,13 @@ int man_main(int argc UNUSED_PARAM, char **argv)
sec_list = xstrdup("1:2:3:4:5:6:7:8:9");
/* Last valid man_path_list[] is [0x10] */
+ count_mp = 0;
man_path_list = xzalloc(0x11 * sizeof(man_path_list[0]));
man_path_list[0] = getenv("MANPATH");
- if (!man_path_list[0])
+ if (!man_path_list[0]) /* default, may be overridden by /etc/man.conf */
man_path_list[0] = (char*)"/usr/man";
- count_mp = 1;
+ else
+ count_mp++;
pager = getenv("MANPAGER");
if (!pager) {
pager = getenv("PAGER");
@@ -181,7 +183,7 @@ int man_main(int argc UNUSED_PARAM, char **argv)
}
/* Parse man.conf */
- parser = config_open("/etc/man.conf");
+ parser = config_open2("/etc/man.conf", fopen_for_read);
while (config_read(parser, token, 2, 0, "# \t", PARSE_NORMAL)) {
if (!token[1])
continue;