version 1.295, 2017/07/01 12:02:31 |
version 1.299, 2017/07/04 14:40:38 |
Line 663 fs_lookup(const struct manpaths *paths, size_t ipath, |
|
Line 663 fs_lookup(const struct manpaths *paths, size_t ipath, |
|
if (globres == 0) |
if (globres == 0) |
file = mandoc_strdup(*globinfo.gl_pathv); |
file = mandoc_strdup(*globinfo.gl_pathv); |
globfree(&globinfo); |
globfree(&globinfo); |
if (globres != 0) |
if (globres == 0) |
|
goto found; |
|
if (res != NULL || ipath + 1 != paths->sz) |
return 0; |
return 0; |
|
|
|
mandoc_asprintf(&file, "%s.%s", name, sec); |
|
globres = access(file, R_OK); |
|
free(file); |
|
return globres != -1; |
|
|
found: |
found: |
warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s", |
warnx("outdated mandoc.db lacks %s(%s) entry, run %s %s", |
name, sec, BINM_MAKEWHATIS, paths->paths[ipath]); |
name, sec, BINM_MAKEWHATIS, paths->paths[ipath]); |
if (res == NULL) |
if (res == NULL) { |
|
free(file); |
return 1; |
return 1; |
|
} |
*res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); |
*res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage)); |
page = *res + (*ressz - 1); |
page = *res + (*ressz - 1); |
page->file = file; |
page->file = file; |
Line 754 parse(struct curparse *curp, int fd, const char *file) |
|
Line 763 parse(struct curparse *curp, int fd, const char *file) |
|
|
|
if (man == NULL) |
if (man == NULL) |
return; |
return; |
if (curp->mmin < MANDOCERR_STYLE) |
mandoc_xr_reset(); |
mandoc_xr_reset(); |
|
if (man->macroset == MACROSET_MDOC) { |
if (man->macroset == MACROSET_MDOC) { |
if (curp->outtype != OUTT_TREE || !curp->outopts->noval) |
if (curp->outtype != OUTT_TREE || !curp->outopts->noval) |
mdoc_validate(man); |
mdoc_validate(man); |
Line 807 parse(struct curparse *curp, int fd, const char *file) |
|
Line 815 parse(struct curparse *curp, int fd, const char *file) |
|
break; |
break; |
} |
} |
} |
} |
check_xr(file); |
if (curp->mmin < MANDOCERR_STYLE) |
|
check_xr(file); |
mparse_updaterc(curp->mp, &rc); |
mparse_updaterc(curp->mp, &rc); |
} |
} |
|
|
Line 824 check_xr(const char *file) |
|
Line 833 check_xr(const char *file) |
|
manpath_base(&paths); |
manpath_base(&paths); |
|
|
for (xr = mandoc_xr_get(); xr != NULL; xr = xr->next) { |
for (xr = mandoc_xr_get(); xr != NULL; xr = xr->next) { |
|
if (xr->line == -1) |
|
continue; |
search.arch = NULL; |
search.arch = NULL; |
search.sec = xr->sec; |
search.sec = xr->sec; |
search.outkey = NULL; |
search.outkey = NULL; |
Line 833 check_xr(const char *file) |
|
Line 844 check_xr(const char *file) |
|
continue; |
continue; |
if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz)) |
if (fs_search(&search, &paths, 1, &xr->name, NULL, &sz)) |
continue; |
continue; |
mandoc_asprintf(&cp, "Xr %s %s", xr->name, xr->sec); |
if (xr->count == 1) |
|
mandoc_asprintf(&cp, "Xr %s %s", xr->name, xr->sec); |
|
else |
|
mandoc_asprintf(&cp, "Xr %s %s (%d times)", |
|
xr->name, xr->sec, xr->count); |
mmsg(MANDOCERR_XR_BAD, MANDOCLEVEL_STYLE, |
mmsg(MANDOCERR_XR_BAD, MANDOCLEVEL_STYLE, |
file, xr->line, xr->pos + 1, cp); |
file, xr->line, xr->pos + 1, cp); |
free(cp); |
free(cp); |
Line 1074 mmsg(enum mandocerr t, enum mandoclevel lvl, |
|
Line 1089 mmsg(enum mandocerr t, enum mandoclevel lvl, |
|
if (line) |
if (line) |
fprintf(stderr, "%d:%d:", line, col + 1); |
fprintf(stderr, "%d:%d:", line, col + 1); |
|
|
fprintf(stderr, " %s", |
fprintf(stderr, " %s", mparse_strlevel(lvl)); |
t < MANDOCERR_STYLE ? "BASE" : mparse_strlevel(lvl)); |
|
|
|
if ((mparse_msg = mparse_strerror(t)) != NULL) |
if ((mparse_msg = mparse_strerror(t)) != NULL) |
fprintf(stderr, ": %s", mparse_msg); |
fprintf(stderr, ": %s", mparse_msg); |