aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-10-21 23:47:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-10-21 23:47:58 +0000
commit6f0fdff7bd838e5309174d1f70528d04e7474a18 (patch)
tree2a08b6583b1b1f3c153b9a539419c9a3d39d0301 /mdoc_validate.c
parentee091385eb708ecd7a3b7c555c2d4172dfdbfa59 (diff)
downloadmandoc-6f0fdff7bd838e5309174d1f70528d04e7474a18.tar.gz
mandoc-6f0fdff7bd838e5309174d1f70528d04e7474a18.tar.zst
mandoc-6f0fdff7bd838e5309174d1f70528d04e7474a18.zip
There are three kinds of input lines: text lines, macros taking
positional arguments (like Dt Fn Xr) and macros taking text as arguments (like Nd Sh Em %T An). In the past, even the latter put each word of their arguments into its own MDOC_TEXT node; instead, concatenate arguments unless delimiters, keeps or spacing mode prevent that. Regarding mandoc(1), this is internal refactoring, no output change intended. Regarding mandocdb(8), this fixes yet another regression introduced when switching from DB to SQLite: The ability to search for strings crossing word boundaries was lost and is hereby restored. At the same time, database sizes and build times are both reduced by a bit more than 5% each.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 415454db..b8605a83 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.196 2013/10/06 22:46:15 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.197 2013/10/21 23:47:58 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -1674,10 +1674,16 @@ ebool(struct mdoc *mdoc)
assert(MDOC_TEXT == mdoc->last->child->type);
- if (0 == strcmp(mdoc->last->child->string, "on"))
+ if (0 == strcmp(mdoc->last->child->string, "on")) {
+ if (MDOC_Sm == mdoc->last->tok)
+ mdoc->flags &= ~MDOC_SMOFF;
return(1);
- if (0 == strcmp(mdoc->last->child->string, "off"))
+ }
+ if (0 == strcmp(mdoc->last->child->string, "off")) {
+ if (MDOC_Sm == mdoc->last->tok)
+ mdoc->flags |= MDOC_SMOFF;
return(1);
+ }
mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_BADBOOL);
return(1);