aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-10-27 16:41:31 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-10-27 16:41:31 +0000
commit574ab36c0e06c06785d95ad51eac94f7759cc8fa (patch)
tree2f35287878639b4ec11f8027920c806c40f27b28 /mandocdb.c
parent20511656c21f33d0727c770400e9597a87775aa2 (diff)
downloadmandoc-574ab36c0e06c06785d95ad51eac94f7759cc8fa.tar.gz
mandoc-574ab36c0e06c06785d95ad51eac94f7759cc8fa.tar.zst
mandoc-574ab36c0e06c06785d95ad51eac94f7759cc8fa.zip
The code in ofmerge() only tried the source parsers if at least one
of the path (/man1/ .. /man9/) or the file name suffix (*.1 .. *.9) indicated a source manual. That missed source manuals with unusual names in unusual locations. Instead, as the existing comment right above already suggests, try the source parsers unless both the path and the file name suffix unambiguously indicate a preformatted manual (/cat*/*.0). This change is not expensive in practice because no real-world system will have large numbers of preformatted pages outside /cat*/*.0. The only way to make information loss even less probable would be to try the source parsers on all files, even /cat*/*.0, which wouldn't buy us much because no real-world system will call source manuals /cat*/*.0, but it will be expensive in practice, because many real-world systems have large numbers of preformatted pages called /cat*/*.0.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index a9e280c5..fab515de 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.74 2013/10/27 16:09:44 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.75 2013/10/27 16:41:31 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -961,7 +961,7 @@ ofmerge(struct mchars *mc, struct mparse *mp, int check_reachable)
* source code, unless it is already known to be
* formatted. Fall back to formatted mode.
*/
- if (FORM_SRC == of->dform || FORM_SRC == of->sform) {
+ if (FORM_CAT != of->dform || FORM_CAT != of->sform) {
lvl = mparse_readfd(mp, -1, of->file);
if (lvl < MANDOCLEVEL_FATAL)
mparse_result(mp, &mdoc, &man);