aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/eqn.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-23 13:31:03 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-23 13:31:03 +0000
commit120b20293594a2d47c4e480f65706a805f0e629b (patch)
tree9eba773c68e77564bfc05c38f9a9bcf7b51223e6 /eqn.c
parenta83e8b87ddf1712de4e78f26949891740aa3898a (diff)
downloadmandoc-120b20293594a2d47c4e480f65706a805f0e629b.tar.gz
mandoc-120b20293594a2d47c4e480f65706a805f0e629b.tar.zst
mandoc-120b20293594a2d47c4e480f65706a805f0e629b.zip
Raise a warning when text follows the `EN'.
Diffstat (limited to 'eqn.c')
-rw-r--r--eqn.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/eqn.c b/eqn.c
index 94ff6798..b8bc5c66 100644
--- a/eqn.c
+++ b/eqn.c
@@ -1,4 +1,4 @@
-/* $Id: eqn.c,v 1.34 2011/07/23 12:10:16 kristaps Exp $ */
+/* $Id: eqn.c,v 1.35 2011/07/23 13:31:03 kristaps Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -285,9 +285,15 @@ eqn_read(struct eqn_node **epp, int ln,
* validate the full equation.
*/
- if (0 == strcmp(p, ".EN")) {
+ if (0 == strncmp(p, ".EN", 3)) {
er = eqn_end(ep);
*epp = NULL;
+ p += 3;
+ while (' ' == *p || '\t' == *p)
+ p++;
+ if ('\0' == *p)
+ return(er);
+ mandoc_msg(MANDOCERR_ARGSLOST, ep->parse, ln, pos, NULL);
return(er);
}