aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-08-10 20:40:45 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-08-10 20:40:45 +0000
commitbbc9692176a7890be65fe472b75bbb307fcf0b62 (patch)
tree4f9be2c872764d4350a61c83c0441ffa2d9c949a /roff_validate.c
parentfbc87aa03d8f797ab884fc9f06443bd748a82ca1 (diff)
downloadmandoc-bbc9692176a7890be65fe472b75bbb307fcf0b62.tar.gz
mandoc-bbc9692176a7890be65fe472b75bbb307fcf0b62.tar.zst
mandoc-bbc9692176a7890be65fe472b75bbb307fcf0b62.zip
The groff man-ext macros define fonts CB, CI, and CR,
and some groff manual pages actually use them in .ft requests. It's easy enough to handle these .ft requests in mandoc, too.
Diffstat (limited to 'roff_validate.c')
-rw-r--r--roff_validate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/roff_validate.c b/roff_validate.c
index 801e9314..6a76a1fb 100644
--- a/roff_validate.c
+++ b/roff_validate.c
@@ -1,6 +1,6 @@
-/* $Id: roff_validate.c,v 1.9 2017/06/14 22:51:25 schwarze Exp $ */
+/* $Id: roff_validate.c,v 1.10 2018/08/10 20:40:45 schwarze Exp $ */
/*
- * Copyright (c) 2010, 2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2017, 2018 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
@@ -18,6 +18,7 @@
#include <assert.h>
#include <stddef.h>
+#include <string.h>
#include "mandoc.h"
#include "roff.h"
@@ -58,7 +59,7 @@ roff_validate(struct roff_man *man)
static void
roff_valid_ft(ROFF_VALID_ARGS)
{
- char *cp;
+ const char *cp;
if (n->child == NULL) {
man->next = ROFF_NEXT_CHILD;
@@ -84,7 +85,8 @@ roff_valid_ft(ROFF_VALID_ARGS)
return;
break;
case 'C':
- if (cp[1] == 'W' && cp[2] == '\0')
+ if (cp[1] != '\0' && cp[2] == '\0' &&
+ strchr("BIRW", cp[1]) != NULL)
return;
break;
default: