summary refs log tree commit diff
path: root/pkgs/tools/misc/man/share.patch
blob: 837786e28eba1f5b86a1a1a6891f12f9af86c262 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
diff -rc man-1.6f-orig/src/manpath.c man-1.6f/src/manpath.c
*** man-1.6f-orig/src/manpath.c	2006-08-03 23:18:33.000000000 +0200
--- man-1.6f/src/manpath.c	2008-02-07 15:31:43.000000000 +0100
***************
*** 109,121 ****
   * or ../man or ../man1 or ../man8 subdirectories. 
   */
  static char *
! find_man_subdir (char *p) {
       int len;
       char *t, *sp;
  
       len = strlen (p);
  
!      t = my_malloc ((unsigned) len + 20);
  
       memcpy (t, p, len);
       strcpy (t + len, "/man");
--- 109,121 ----
   * or ../man or ../man1 or ../man8 subdirectories. 
   */
  static char *
! find_man_subdir (char *p, char * maybe_share) {
       int len;
       char *t, *sp;
  
       len = strlen (p);
  
!      t = my_malloc ((unsigned) len + 30);
  
       memcpy (t, p, len);
       strcpy (t + len, "/man");
***************
*** 139,159 ****
       }
  
       /* look for the situation with packagedir/bin and packagedir/man */
!      strcpy (t + len, "/man");
  
       if (is_directory (t) == 1)
  	  return t;
  
       /* look for the situation with pkg/bin and pkg/man1 or pkg/man8 */
       /* (looking for all man[1-9] would probably be a waste of stats) */
!      strcpy (t + len, "/man1");
  
       if (is_directory (t) == 1) {
  	  t[len] = 0;
  	  return t;
       }
  
!      strcpy (t + len, "/man8");
  
       if (is_directory (t) == 1) {
  	  t[len] = 0;
--- 139,159 ----
       }
  
       /* look for the situation with packagedir/bin and packagedir/man */
!      sprintf (t + len, "%s/man", maybe_share);
  
       if (is_directory (t) == 1)
  	  return t;
  
       /* look for the situation with pkg/bin and pkg/man1 or pkg/man8 */
       /* (looking for all man[1-9] would probably be a waste of stats) */
!      sprintf (t + len, "%s/man1", maybe_share);
  
       if (is_directory (t) == 1) {
  	  t[len] = 0;
  	  return t;
       }
  
!      sprintf (t + len, "%s/man8", maybe_share);
  
       if (is_directory (t) == 1) {
  	  t[len] = 0;
***************
*** 341,347 ****
          if (debug)
              gripe (IS_NOT_IN_CONFIG);
            
!         t = find_man_subdir (dir);
          if (t != NULL) {
              if (debug)
                  gripe (MAN_NEARBY);
--- 341,347 ----
          if (debug)
              gripe (IS_NOT_IN_CONFIG);
            
!         t = find_man_subdir (dir, "");
          if (t != NULL) {
              if (debug)
                  gripe (MAN_NEARBY);
***************
*** 352,357 ****
--- 352,370 ----
              if (debug)
                  gripe (NO_MAN_NEARBY);
          }
+ 
+         t = find_man_subdir (dir, "/share");
+         if (t != NULL) {
+             if (debug)
+                 gripe (MAN_NEARBY);
+               
+             add_to_mandirlist (t, perrs);
+             free (t);
+         } else {
+             if (debug)
+                 gripe (NO_MAN_NEARBY);
+         }
+ 
      }
  }