man-db-2.6.3-overrides.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. diff -up man-db-2.6.3/src/manp.c.overrides man-db-2.6.3/src/manp.c
  2. --- man-db-2.6.3/src/manp.c.overrides 2012-10-24 16:52:35.134486439 +0200
  3. +++ man-db-2.6.3/src/manp.c 2012-10-24 16:59:28.300037133 +0200
  4. @@ -51,6 +51,7 @@
  5. #include <ctype.h>
  6. #include <sys/types.h>
  7. #include <sys/stat.h>
  8. +#include <sys/param.h>
  9. #include <assert.h>
  10. #include <errno.h>
  11. #include <dirent.h>
  12. @@ -95,6 +96,9 @@ static struct list *namestore, *tailstor
  13. #define MANPATH_MAP 0
  14. #define MANDATORY 1
  15. +/* Subdirectory of MANPATH entries searched for man pages before the directory itself. */
  16. +#define OVERRIDES_DIR "/overrides"
  17. +
  18. /* DIRLIST list[MAXDIRS]; */
  19. static char *tmplist[MAXDIRS];
  20. @@ -933,6 +937,7 @@ char *get_manpath_from_path (const char
  21. char **lp;
  22. char *end;
  23. char *manpathlist;
  24. + char overrides[MAXPATHLEN];
  25. struct list *list;
  26. tmppath = xstrdup (path);
  27. @@ -960,6 +965,9 @@ char *get_manpath_from_path (const char
  28. if (mandir_list) {
  29. debug ("is in the config file\n");
  30. while (mandir_list) {
  31. + strcpy(overrides, mandir_list->cont);
  32. + strcat(overrides, OVERRIDES_DIR);
  33. + add_dir_to_list (tmplist, overrides);
  34. add_dir_to_list (tmplist, mandir_list->cont);
  35. mandir_list = iterate_over_list
  36. (mandir_list, p, MANPATH_MAP);
  37. @@ -978,6 +986,9 @@ char *get_manpath_from_path (const char
  38. "../share/man, or share/man "
  39. "subdirectory\n");
  40. + strcpy(overrides, t);
  41. + strcat(overrides, OVERRIDES_DIR);
  42. + add_dir_to_list (tmplist, overrides);
  43. add_dir_to_list (tmplist, t);
  44. free (t);
  45. } else
  46. @@ -993,8 +1004,12 @@ char *get_manpath_from_path (const char
  47. debug ("\nadding mandatory man directories\n\n");
  48. for (list = namestore; list; list = list->next)
  49. - if (list->flag == MANDATORY)
  50. + if (list->flag == MANDATORY) {
  51. + strcpy(overrides, list->key);
  52. + strcat(overrides, OVERRIDES_DIR);
  53. + add_dir_to_list (tmplist, overrides);
  54. add_dir_to_list (tmplist, list->key);
  55. + }
  56. }
  57. len = 0;