17 |
17 |
* information: Portions Copyright [yyyy] [name of copyright owner]
|
18 |
18 |
*
|
19 |
19 |
* CDDL HEADER END
|
20 |
|
*/
|
21 |
|
/*
|
|
20 |
*
|
|
21 |
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
|
22 |
22 |
* Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved.
|
23 |
23 |
*/
|
24 |
24 |
|
25 |
|
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T. */
|
26 |
|
/* All rights reserved. */
|
|
25 |
/*
|
|
26 |
* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T.
|
|
27 |
* All rights reserved.
|
|
28 |
*/
|
27 |
29 |
|
28 |
30 |
/*
|
29 |
31 |
* University Copyright- Copyright (c) 1982, 1986, 1988
|
... | ... | |
1861 |
1863 |
char sectpath[MAXPATHLEN+1];
|
1862 |
1864 |
char file[MAXNAMLEN+1];
|
1863 |
1865 |
char dname[MAXPATHLEN+1];
|
1864 |
|
char *last;
|
1865 |
|
int nlen;
|
|
1866 |
int last;
|
1866 |
1867 |
|
1867 |
1868 |
/*
|
1868 |
1869 |
* TRANSLATION_NOTE - message for man -d or catman -p
|
... | ... | |
1870 |
1871 |
*/
|
1871 |
1872 |
DPRINTF(gettext(" scanning = %s\n"), dir);
|
1872 |
1873 |
(void) sprintf(sectpath, "%s/%s", path, dir);
|
1873 |
|
(void) snprintf(file, MAXPATHLEN, "%s.", name);
|
|
1874 |
(void) snprintf(file, MAXPATHLEN, "%s", name);
|
1874 |
1875 |
|
1875 |
1876 |
if ((sdp = opendir(sectpath)) == 0) {
|
1876 |
1877 |
if (errno != ENOTDIR) /* ignore matching cruft */
|
... | ... | |
1878 |
1879 |
return (0);
|
1879 |
1880 |
}
|
1880 |
1881 |
while ((sd = readdir(sdp))) {
|
1881 |
|
last = strrchr(sd->d_name, '.');
|
1882 |
|
nlen = last - sd->d_name;
|
1883 |
|
(void) sprintf(dname, "%.*s.", nlen, sd->d_name);
|
|
1882 |
for (last = strlen(sd->d_name)-1; last > 0; last--) {
|
|
1883 |
/* hacky support for .gz */
|
|
1884 |
if (last > 1 && sd->d_name[last-2] == '.' &&
|
|
1885 |
sd->d_name[last-1] == 'g' && sd->d_name[last] == 'z')
|
|
1886 |
last -= 3;
|
|
1887 |
if (sd->d_name[last] == '.')
|
|
1888 |
break;
|
|
1889 |
}
|
|
1890 |
(void) strncpy(dname, sd->d_name, last);
|
|
1891 |
dname[last] = '\0';
|
1884 |
1892 |
if (eq(dname, file) || eq(sd->d_name, name)) {
|
1885 |
1893 |
if (no_sroff && *dir == 's') {
|
1886 |
1894 |
sman_no_man_no_sroff = 1;
|
... | ... | |
2338 |
2346 |
char *new_m;
|
2339 |
2347 |
char *tmpsubdir;
|
2340 |
2348 |
|
|
2349 |
/* hacky support for .gz */
|
|
2350 |
int pg_len, gzipit = ((pg_len = strlen(pg)) > 2 && pg[pg_len-3] == '.'
|
|
2351 |
&& pg[pg_len-2] == 'g' && pg[pg_len-1] == 'z');
|
|
2352 |
|
2341 |
2353 |
found++;
|
2342 |
2354 |
|
2343 |
2355 |
if (*dir != 'm' && *dir != 's')
|
... | ... | |
2777 |
2789 |
macros, troffit ? "" : " | col -x", tmpname);
|
2778 |
2790 |
|
2779 |
2791 |
} else
|
2780 |
|
(void) sprintf(cbp, "%s %s %s%s > %s",
|
|
2792 |
(void) sprintf(cbp, "%s %s | %s - %s%s > %s",
|
|
2793 |
gzipit ? "gzip -c -d" : "cat",
|
|
2794 |
pipestage == 0 ? manpname : "-",
|
2781 |
2795 |
troffit ? troffcmd : "nroff -u0 -Tlp",
|
2782 |
|
macros, pipestage == 0 ? manpname : "-",
|
2783 |
|
troffit ? "" : " | col -x", tmpname);
|
|
2796 |
macros, troffit ? "" : " | col -x", tmpname);
|
2784 |
2797 |
|
2785 |
2798 |
/* Reformat the page. */
|
2786 |
2799 |
if (sys(cmdbuf)) {
|