diff options
author | Colin Watson <cjwatson@debian.org> | 2003-02-22 17:46:01 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2003-02-22 17:46:01 +0000 |
commit | 6b78e6f6187d86fea64d8c5d8f1e9329e882bddd (patch) | |
tree | 02daf1a9cca09985c3fb86cabd2758a73eb9851c /src/manp.c | |
parent | 15f0fe82821a045565d1fad1cf0363a8c82c6c87 (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.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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) |