summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-02 19:55:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-02 19:55:10 +0000
commitfdc95e0f088e210664eb7459003c922102fc748e (patch)
tree2941a73b51965c3192f9e63b7579762c3e8c0ad5 /mdoc_validate.c
parente98d951b402f5f61bf0fafc86ae5ad5a03f1c85e (diff)
downloadmandoc-fdc95e0f088e210664eb7459003c922102fc748e.tar.gz
When .Sm is called without an argument, groff toggles the spacing mode,
so let us do the same for compatibility. Using this feature is of course not recommended except in manual page obfuscation contests.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index cf75c67a..ecd1ee09 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1668,11 +1668,12 @@ ebool(struct mdoc *mdoc)
{
if (NULL == mdoc->last->child) {
- mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_MACROEMPTY);
- mdoc_node_delete(mdoc, mdoc->last);
+ if (MDOC_Sm == mdoc->last->tok)
+ mdoc->flags ^= MDOC_SMOFF;
return(1);
}
- check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_EQ, 1);
+
+ check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_LT, 2);
assert(MDOC_TEXT == mdoc->last->child->type);