diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-09-14 21:30:35 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-09-14 21:30:35 +0000 |
commit | a1e16c9298756e54161d9bf7d24b03415e2707c0 (patch) | |
tree | c74cfdeb08ad7fe930e21306e8c4a7066bb84b42 /miscutils | |
parent | e357d2ae6833e3ca306f3aa6e12c6ddf2ff1eae2 (diff) | |
download | busybox-w32-a1e16c9298756e54161d9bf7d24b03415e2707c0.tar.gz busybox-w32-a1e16c9298756e54161d9bf7d24b03415e2707c0.tar.bz2 busybox-w32-a1e16c9298756e54161d9bf7d24b03415e2707c0.zip |
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')
-rw-r--r-- | miscutils/man.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/miscutils/man.c b/miscutils/man.c index 26fd44ddf..24551c0e0 100644 --- a/miscutils/man.c +++ b/miscutils/man.c | |||
@@ -168,11 +168,13 @@ int man_main(int argc UNUSED_PARAM, char **argv) | |||
168 | 168 | ||
169 | sec_list = xstrdup("1:2:3:4:5:6:7:8:9"); | 169 | sec_list = xstrdup("1:2:3:4:5:6:7:8:9"); |
170 | /* Last valid man_path_list[] is [0x10] */ | 170 | /* Last valid man_path_list[] is [0x10] */ |
171 | count_mp = 0; | ||
171 | man_path_list = xzalloc(0x11 * sizeof(man_path_list[0])); | 172 | man_path_list = xzalloc(0x11 * sizeof(man_path_list[0])); |
172 | man_path_list[0] = getenv("MANPATH"); | 173 | man_path_list[0] = getenv("MANPATH"); |
173 | if (!man_path_list[0]) | 174 | if (!man_path_list[0]) /* default, may be overridden by /etc/man.conf */ |
174 | man_path_list[0] = (char*)"/usr/man"; | 175 | man_path_list[0] = (char*)"/usr/man"; |
175 | count_mp = 1; | 176 | else |
177 | count_mp++; | ||
176 | pager = getenv("MANPAGER"); | 178 | pager = getenv("MANPAGER"); |
177 | if (!pager) { | 179 | if (!pager) { |
178 | pager = getenv("PAGER"); | 180 | pager = getenv("PAGER"); |
@@ -181,7 +183,7 @@ int man_main(int argc UNUSED_PARAM, char **argv) | |||
181 | } | 183 | } |
182 | 184 | ||
183 | /* Parse man.conf */ | 185 | /* Parse man.conf */ |
184 | parser = config_open("/etc/man.conf"); | 186 | parser = config_open2("/etc/man.conf", fopen_for_read); |
185 | while (config_read(parser, token, 2, 0, "# \t", PARSE_NORMAL)) { | 187 | while (config_read(parser, token, 2, 0, "# \t", PARSE_NORMAL)) { |
186 | if (!token[1]) | 188 | if (!token[1]) |
187 | continue; | 189 | continue; |