source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: when splitting a composite word,  do not forget to close the
Date: Mon, 26 Jun 2017 06:05:17 -0500 (EST)	[thread overview]
Message-ID: <4404839292126308030.enqueue@fantadrom.bsd.lv> (raw)

Log Message:
-----------
when splitting a composite word, 
do not forget to close the inserted list box

Modified Files:
--------------
    mandoc:
        eqn.c

Revision Data
-------------
Index: eqn.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/eqn.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -Leqn.c -Leqn.c -u -p -r1.69 -r1.70
--- eqn.c
+++ eqn.c
@@ -1,4 +1,4 @@
-/*	$Id$
+/*	$Id$ */
 /*
  * Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -722,7 +722,7 @@ static enum rofferr
 eqn_parse(struct eqn_node *ep, struct eqn_box *parent)
 {
 	char		 sym[64];
-	struct eqn_box	*cur, *nbox;
+	struct eqn_box	*cur, *nbox, *split;
 	const char	*cp, *cpn, *start;
 	char		*p;
 	size_t		 sz;
@@ -1118,6 +1118,7 @@ this_tok:
 				break;
 			cpn = p - 1;
 			ccln = CCL_LET;
+			split = NULL;
 			for (;;) {
 				/* Advance to next character. */
 				cp = cpn++;
@@ -1149,13 +1150,13 @@ this_tok:
 					parent->last = cur->prev;
 					parent->args--;
 					/* Set up a list instead. */
-					nbox = eqn_box_alloc(ep, parent);
-					nbox->type = EQN_LIST;
+					split = eqn_box_alloc(ep, parent);
+					split->type = EQN_LIST;
 					/* Insert the word into the list. */
-					nbox->first = nbox->last = cur;
-					cur->parent = nbox;
+					split->first = split->last = cur;
+					cur->parent = split;
 					cur->prev = NULL;
-					parent = nbox;
+					parent = split;
 				}
 				/* Append a new text box. */
 				nbox = eqn_box_alloc(ep, parent);
@@ -1172,6 +1173,8 @@ this_tok:
 				cpn = p - 1;
 				ccln = CCL_LET;
 			}
+			if (split != NULL)
+				parent = split->parent;
 			break;
 		}
 		/*
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv

                 reply	other threads:[~2017-06-26 11:05 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=4404839292126308030.enqueue@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.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).