Upstream: https://opensource.apple.com/source/man/man-16/patches/PR11291804-xcode.diff
The header file "xcselect.h" referenced in the original patch is not available
in the OS X SDK. The local modification in this patch provide the necessary
declarations as implied by the context and put them right into this file.
--- src/manpath.c.orig 2005-08-20 16:26:06.000000000 -0700
+++ src/manpath.c 2012-10-17 13:05:56.000000000 -0700
+typedef struct xcselect_manpaths xcselect_manpaths;
+xcselect_manpaths *xcselect_get_manpaths(char *sdkname);
+unsigned int xcselect_manpaths_get_num_paths(xcselect_manpaths *xcp);
+const char *xcselect_manpaths_get_path(xcselect_manpaths *xcp, unsigned i);
+void xcselect_manpaths_free(xcselect_manpaths *xcp);
/* not always in <string.h> */
extern char *index(const char *, int);
for (dlp = cfdirlist.nxt; dlp; dlp = dlp->nxt)
add_to_mandirlist (dlp->mandir, perrs);
+ xcselect_manpaths *xcp;
+ // TODO: pass something for sdkname
+ xcp = xcselect_get_manpaths(NULL);
+ count = xcselect_manpaths_get_num_paths(xcp);
+ for (i = 0; i < count; i++) {
+ path = xcselect_manpaths_get_path(xcp, i);
+ add_to_mandirlist((char *)path, perrs);
+ xcselect_manpaths_free(xcp);