From 120b20293594a2d47c4e480f65706a805f0e629b Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 23 Jul 2011 13:31:03 +0000 Subject: Raise a warning when text follows the `EN'. --- eqn.c | 10 ++++++++-- 1 file 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 * @@ -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); } -- cgit v1.2.3-56-ge451