|
|
5212c6 |
diff -up man-db-2.6.3/src/manp.c.overrides man-db-2.6.3/src/manp.c
|
|
|
5212c6 |
--- man-db-2.6.3/src/manp.c.overrides 2012-10-24 16:52:35.134486439 +0200
|
|
|
5212c6 |
+++ man-db-2.6.3/src/manp.c 2012-10-24 16:59:28.300037133 +0200
|
|
|
5212c6 |
@@ -51,6 +51,7 @@
|
|
|
5212c6 |
#include <ctype.h>
|
|
|
5212c6 |
#include <sys/types.h>
|
|
|
5212c6 |
#include <sys/stat.h>
|
|
|
5212c6 |
+#include <sys/param.h>
|
|
|
5212c6 |
#include <assert.h>
|
|
|
5212c6 |
#include <errno.h>
|
|
|
5212c6 |
#include <dirent.h>
|
|
|
5212c6 |
@@ -95,6 +96,9 @@ static struct list *namestore, *tailstor
|
|
|
5212c6 |
#define MANPATH_MAP 0
|
|
|
5212c6 |
#define MANDATORY 1
|
|
|
5212c6 |
|
|
|
5212c6 |
+/* Subdirectory of MANPATH entries searched for man pages before the directory itself. */
|
|
|
5212c6 |
+#define OVERRIDES_DIR "/overrides"
|
|
|
5212c6 |
+
|
|
|
5212c6 |
/* DIRLIST list[MAXDIRS]; */
|
|
|
5212c6 |
static char *tmplist[MAXDIRS];
|
|
|
5212c6 |
|
|
|
5212c6 |
@@ -933,6 +937,7 @@ char *get_manpath_from_path (const char
|
|
|
5212c6 |
char **lp;
|
|
|
5212c6 |
char *end;
|
|
|
5212c6 |
char *manpathlist;
|
|
|
5212c6 |
+ char overrides[MAXPATHLEN];
|
|
|
5212c6 |
struct list *list;
|
|
|
5212c6 |
|
|
|
5212c6 |
tmppath = xstrdup (path);
|
|
|
5212c6 |
@@ -960,6 +965,9 @@ char *get_manpath_from_path (const char
|
|
|
5212c6 |
if (mandir_list) {
|
|
|
5212c6 |
debug ("is in the config file\n");
|
|
|
5212c6 |
while (mandir_list) {
|
|
|
5212c6 |
+ strcpy(overrides, mandir_list->cont);
|
|
|
5212c6 |
+ strcat(overrides, OVERRIDES_DIR);
|
|
|
5212c6 |
+ add_dir_to_list (tmplist, overrides);
|
|
|
5212c6 |
add_dir_to_list (tmplist, mandir_list->cont);
|
|
|
5212c6 |
mandir_list = iterate_over_list
|
|
|
5212c6 |
(mandir_list, p, MANPATH_MAP);
|
|
|
5212c6 |
@@ -978,6 +986,9 @@ char *get_manpath_from_path (const char
|
|
|
5212c6 |
"../share/man, or share/man "
|
|
|
5212c6 |
"subdirectory\n");
|
|
|
5212c6 |
|
|
|
5212c6 |
+ strcpy(overrides, t);
|
|
|
5212c6 |
+ strcat(overrides, OVERRIDES_DIR);
|
|
|
5212c6 |
+ add_dir_to_list (tmplist, overrides);
|
|
|
5212c6 |
add_dir_to_list (tmplist, t);
|
|
|
5212c6 |
free (t);
|
|
|
5212c6 |
} else
|
|
|
5212c6 |
@@ -993,8 +1004,12 @@ char *get_manpath_from_path (const char
|
|
|
5212c6 |
debug ("\nadding mandatory man directories\n\n");
|
|
|
5212c6 |
|
|
|
5212c6 |
for (list = namestore; list; list = list->next)
|
|
|
5212c6 |
- if (list->flag == MANDATORY)
|
|
|
5212c6 |
+ if (list->flag == MANDATORY) {
|
|
|
5212c6 |
+ strcpy(overrides, list->key);
|
|
|
5212c6 |
+ strcat(overrides, OVERRIDES_DIR);
|
|
|
5212c6 |
+ add_dir_to_list (tmplist, overrides);
|
|
|
5212c6 |
add_dir_to_list (tmplist, list->key);
|
|
|
5212c6 |
+ }
|
|
|
5212c6 |
}
|
|
|
5212c6 |
|
|
|
5212c6 |
len = 0;
|