subscripts, superscripts, or "from" or "to" arguments.
Found by jsg@ with afl.
-# $OpenBSD: Makefile,v 1.1.1.1 2015/01/01 12:53:46 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2015/01/01 15:34:43 schwarze Exp $
-REGRESS_TARGETS = basic
-HTML_TARGETS = basic
+REGRESS_TARGETS = basic noarg
+HTML_TARGETS = basic noarg
.include <bsd.regress.mk>
--- /dev/null
+.Dd January 1, 2015
+.Dt FROMTO-NOARG 1
+.Os OpenBSD
+.Sh NAME
+.Nm fromto-noarg
+.Nd vertical stacking lacks final argument
+.Sh DESCRIPTION
+initial text
+.EQ
+x from a to to
+.EN
+final text
--- /dev/null
+FROMTO-NOARG(1) General Commands Manual FROMTO-NOARG(1)
+
+N\bNA\bAM\bME\bE
+ f\bfr\bro\bom\bmt\bto\bo-\b-n\bno\boa\bar\brg\bg - vertical stacking lacks final argument
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ initial text x_a^^ final text
+
+OpenBSD January 1, 2015 OpenBSD
--- /dev/null
+<mrow><munderover><mi>x</mi><mover><mi>a</mi></mover></munderover></mrow>
-# $OpenBSD: Makefile,v 1.1.1.1 2015/01/01 12:53:46 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2015/01/01 15:34:43 schwarze Exp $
-REGRESS_TARGETS = precedence
-HTML_TARGETS = precedence
+REGRESS_TARGETS = noarg precedence
+HTML_TARGETS = noarg precedence
+LINT_TARGETS = noarg
.include <bsd.regress.mk>
--- /dev/null
+.Dd January 1, 2015
+.Dt OVER-NOARG 1
+.Os OpenBSD
+.Sh NAME
+.Nm over-noarg
+.Nd fraction operator without arguments
+.Sh DESCRIPTION
+initial text
+.EQ
+over over
+.EN
+final text
--- /dev/null
+OVER-NOARG(1) General Commands Manual OVER-NOARG(1)
+
+N\bNA\bAM\bME\bE
+ o\bov\bve\ber\br-\b-n\bno\boa\bar\brg\bg - fraction operator without arguments
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ initial text // final text
+
+OpenBSD January 1, 2015 OpenBSD
--- /dev/null
+<mrow><mfrac><mfrac><mi></mi></mfrac></mfrac></mrow>
--- /dev/null
+mandoc: noarg.in:9:1: WARNING: missing eqn box, using "": over
-# $OpenBSD: Makefile,v 1.1.1.1 2015/01/01 12:53:46 schwarze Exp $
+# $OpenBSD: Makefile,v 1.2 2015/01/01 15:34:43 schwarze Exp $
-REGRESS_TARGETS = combine sub_group
-HTML_TARGETS = combine sub_group
+REGRESS_TARGETS = combine noarg sub_group
+HTML_TARGETS = combine noarg sub_group
.include <bsd.regress.mk>
--- /dev/null
+.Dd January 1, 2015
+.Dt SUBSUP-NOARG 1
+.Os OpenBSD
+.Sh NAME
+.Nm subsup-noarg
+.Nd empty subscripts and superscripts
+.Sh DESCRIPTION
+initial text
+.EQ
+x sub 1 sup sup
+.EN
+final text
--- /dev/null
+SUBSUP-NOARG(1) General Commands Manual SUBSUP-NOARG(1)
+
+N\bNA\bAM\bME\bE
+ s\bsu\bub\bbs\bsu\bup\bp-\b-n\bno\boa\bar\brg\bg - empty subscripts and superscripts
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ initial text x_1^^ final text
+
+OpenBSD January 1, 2015 OpenBSD
--- /dev/null
+<mrow><msubsup><mi>x</mi><msup><mi>1</mi></msup></msubsup></mrow>
-/* $OpenBSD: eqn_term.c,v 1.3 2014/10/12 14:48:25 schwarze Exp $ */
+/* $OpenBSD: eqn_term.c,v 1.4 2015/01/01 15:34:43 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
bp->pos == EQNPOS_TO) ? "^" : "_");
p->flags |= TERMP_NOSPACE;
child = child->next;
- eqn_box(p, child);
- if (bp->pos == EQNPOS_FROMTO ||
- bp->pos == EQNPOS_SUBSUP) {
- p->flags |= TERMP_NOSPACE;
- term_word(p, "^");
- p->flags |= TERMP_NOSPACE;
- child = child->next;
+ if (child != NULL) {
eqn_box(p, child);
+ if (bp->pos == EQNPOS_FROMTO ||
+ bp->pos == EQNPOS_SUBSUP) {
+ p->flags |= TERMP_NOSPACE;
+ term_word(p, "^");
+ p->flags |= TERMP_NOSPACE;
+ child = child->next;
+ if (child != NULL)
+ eqn_box(p, child);
+ }
}
} else {
child = bp->first;