source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: The code in ofmerge() only tried the source parsers if at least
@ 2013-10-27 16:41 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2013-10-27 16:41 UTC (permalink / raw)
  To: source

Log Message:
-----------
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.

Modified Files:
--------------
    mdocml:
        mandocdb.c

Revision Data
-------------
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.74 -r1.75
--- mandocdb.c
+++ mandocdb.c
@@ -961,7 +961,7 @@ ofmerge(struct mchars *mc, struct mparse
 		 * 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);
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-10-27 16:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-27 16:41 mdocml: The code in ofmerge() only tried the source parsers if at least schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).