1 commit 9089291006a4258c39c75a920ad536b61504251a
2 Author: rnhmjoj <rnhmjoj@inventati.org>
3 Date: Fri May 1 19:32:15 2020 +0200
5 check for systemwide man_db.conf before the bundled one
7 diff --git a/src/manp.c b/src/manp.c
8 index 5441339..0bbf566 100644
11 @@ -841,18 +841,24 @@ void read_config_file (bool optional)
14 if (getenv ("MAN_TEST_DISABLE_SYSTEM_CONFIG") == NULL) {
15 - config_file = fopen (CONFIG_FILE, "r");
16 + const char *config_filepath;
17 + if (access ("/etc/man_db.conf", F_OK) != -1) {
18 + config_filepath = "/etc/man_db.conf";
20 + config_filepath = CONFIG_FILE;
22 + config_file = fopen (config_filepath, "r");
23 if (config_file == NULL) {
25 debug ("can't open %s; continuing anyway\n",
30 _ ("can't open the manpath "
31 "configuration file %s"),
35 - debug ("From the config file %s:\n", CONFIG_FILE);
36 + debug ("From the config file %s:\n", config_filepath);
38 add_to_dirlist (config_file, 0);