source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: The code in ofmerge() only tried the source parsers if at least
Date: Sun, 27 Oct 2013 12:41:31 -0400 (EDT)	[thread overview]
Message-ID: <201310271641.r9RGfVmE018490@krisdoz.my.domain> (raw)

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

                 reply	other threads:[~2013-10-27 16:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201310271641.r9RGfVmE018490@krisdoz.my.domain \
    --to=schwarze@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).