summaryrefslogtreecommitdiff
path: root/src/manp.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2003-02-22 17:46:01 +0000
committerColin Watson <cjwatson@debian.org>2003-02-22 17:46:01 +0000
commit6b78e6f6187d86fea64d8c5d8f1e9329e882bddd (patch)
tree02daf1a9cca09985c3fb86cabd2758a73eb9851c /src/manp.c
parent15f0fe82821a045565d1fad1cf0363a8c82c6c87 (diff)
All programs that read ~/.manpath now take a -C option to cause them to
read a different user configuration file instead.
Diffstat (limited to 'src/manp.c')
-rw-r--r--src/manp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/manp.c b/src/manp.c
index 9e6f9701..03ec78e0 100644
--- a/src/manp.c
+++ b/src/manp.c
@@ -119,6 +119,8 @@ static struct list *namestore, *tailstore;
char *tmplist[MAXDIRS];
char *manpathlist[MAXDIRS];
+char *user_config_file = NULL;
+
static void mkcatdirs (const char *mandir, const char *catdir);
static __inline__ char *get_manpath (char *path);
static __inline__ char *has_mandir (const char *p);
@@ -758,7 +760,11 @@ void read_config_file(void)
home = xstrdup (getenv ("HOME"));
if (home) {
- char *dotmanpath = strappend (home, "/.manpath", NULL);
+ char *dotmanpath;
+ if (!user_config_file)
+ dotmanpath = strappend (home, "/.manpath", NULL);
+ else
+ dotmanpath = xstrdup (user_config_file);
config = fopen (dotmanpath, "r");
if (config != NULL) {
if (debug)