svn commit: trunk/busybox/miscutils

vda at busybox.net vda at busybox.net
Sun Sep 14 21:30:35 UTC 2008


Author: vda
Date: 2008-09-14 14:30:35 -0700 (Sun, 14 Sep 2008)
New Revision: 23400

Log:
man: do not use default if /etc/man.conf has different MANPATH
 do not warn if /etc/man.conf does not exist



Modified:
   trunk/busybox/miscutils/man.c


Changeset:
Modified: trunk/busybox/miscutils/man.c
===================================================================
--- trunk/busybox/miscutils/man.c	2008-09-14 21:26:55 UTC (rev 23399)
+++ trunk/busybox/miscutils/man.c	2008-09-14 21:30:35 UTC (rev 23400)
@@ -168,11 +168,13 @@
 
 	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 @@
 	}
 
 	/* 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;




More information about the busybox-cvs mailing list