From 574ab36c0e06c06785d95ad51eac94f7759cc8fa Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 27 Oct 2013 16:41:31 +0000 Subject: 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. --- mandocdb.c | 4 ++-- 1 file 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 * Copyright (c) 2011, 2012, 2013 Ingo Schwarze @@ -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); -- cgit v1.2.3-56-ge451