diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-10-27 16:41:31 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-10-27 16:41:31 +0000 |
commit | c47678add39e26a9ea194b1804414fb58c2198f6 (patch) | |
tree | 1cdd4e55adfbb61ef81b14d71f11e0a2e10a433f /mandocdb.c | |
parent | 76da349d93ea5c3baff16da7953228a8920aeea6 (diff) | |
download | mandoc-c47678add39e26a9ea194b1804414fb58c2198f6.tar.gz |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |