Lines Matching refs:mand
466 char *mand = NULL; in build_manpath() local
475 if ((mand = path_to_manpath(*p)) == NULL) in build_manpath()
478 *p = mand; in build_manpath()
1505 char *mand, *p; in path_to_manpath() local
1516 if ((mand = strdup(bintoman[i].mandir)) == NULL) in path_to_manpath()
1518 if ((p = strchr(mand, ',')) != NULL) in path_to_manpath()
1520 if (stat(mand, &sb) != 0) { in path_to_manpath()
1521 free(mand); in path_to_manpath()
1526 return (mand); in path_to_manpath()
1534 if ((mand = malloc(MAXPATHLEN)) == NULL) in path_to_manpath()
1536 if (strlcpy(mand, bindir, MAXPATHLEN) >= MAXPATHLEN) { in path_to_manpath()
1537 free(mand); in path_to_manpath()
1545 for (p = mand; *p != '\0'; p++) in path_to_manpath()
1547 for (; p > mand && *p == '/'; p--) in path_to_manpath()
1549 for (; p > mand && *p != '/'; p--) in path_to_manpath()
1551 if (p == mand && *p == '.') { in path_to_manpath()
1552 if (realpath("..", mand) == NULL) { in path_to_manpath()
1553 free(mand); in path_to_manpath()
1562 if (strlcat(mand, "/share/man", MAXPATHLEN) >= MAXPATHLEN) { in path_to_manpath()
1563 free(mand); in path_to_manpath()
1567 if ((stat(mand, &sb) == 0) && S_ISDIR(sb.st_mode)) { in path_to_manpath()
1568 return (mand); in path_to_manpath()
1575 if (strlcat(mand, "/man", MAXPATHLEN) >= MAXPATHLEN) { in path_to_manpath()
1576 free(mand); in path_to_manpath()
1579 if ((stat(mand, &sb) == 0) && S_ISDIR(sb.st_mode)) { in path_to_manpath()
1580 return (mand); in path_to_manpath()
1586 free(mand); in path_to_manpath()