source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: pass empty request lines through to tbl(7); sometimes, they end
Date: Tue, 20 Jan 2015 21:17:22 -0500 (EST)	[thread overview]
Message-ID: <2387397039255564235.enqueue@fantadrom.bsd.lv> (raw)

Log Message:
-----------
pass empty request lines through to tbl(7); sometimes, they end a layout

Modified Files:
--------------
    mdocml:
        roff.c

Revision Data
-------------
Index: roff.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/roff.c,v
retrieving revision 1.251
retrieving revision 1.252
diff -Lroff.c -Lroff.c -u -p -r1.251 -r1.252
--- roff.c
+++ roff.c
@@ -1166,13 +1166,13 @@ roff_parseln(struct roff *r, int ln, str
 
 	/*
 	 * First, if a scope is open and we're not a macro, pass the
-	 * text through the macro's filter.  If a scope isn't open and
-	 * we're not a macro, just let it through.
-	 * Finally, if there's an equation scope open, divert it into it
-	 * no matter our state.
+	 * text through the macro's filter.
+	 * Equations process all content themselves.
+	 * Tables process almost all content themselves, but we want
+	 * to warn about macros before passing it there.
 	 */
 
-	if (r->last && ! ctl) {
+	if (r->last != NULL && ! ctl) {
 		t = r->last->tok;
 		assert(roffs[t].text);
 		e = (*roffs[t].text)(r, t, buf, ln, pos, pos, offs);
@@ -1180,13 +1180,12 @@ roff_parseln(struct roff *r, int ln, str
 		if (e != ROFF_CONT)
 			return(e);
 	}
-	if (r->eqn)
+	if (r->eqn != NULL)
 		return(eqn_read(&r->eqn, ln, buf->buf, ppos, offs));
-	if ( ! ctl) {
-		if (r->tbl)
-			return(tbl_read(r->tbl, ln, buf->buf, pos));
+	if (r->tbl != NULL && ( ! ctl || buf->buf[pos] == '\0'))
+		return(tbl_read(r->tbl, ln, buf->buf, pos));
+	if ( ! ctl)
 		return(roff_parsetext(buf, pos, offs));
-	}
 
 	/* Skip empty request lines. */
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

                 reply	other threads:[~2015-01-21  2:17 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=2387397039255564235.enqueue@fantadrom.bsd.lv \
    --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).