aboutsummaryrefslogtreecommitdiff
path: root/miscutils/man.c
diff options
context:
space:
mode:
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 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;