summaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2008-12-04 16:34:59 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2008-12-04 16:34:59 +0000
commita705f91ffa6329b5fc3e6c09ce337b0972c19e2e (patch)
tree24b987382872da9c87d33e083a60e72e3afe4644 /roff.c
parent9b08769d420c8fb749fc6b70d3118ead5f54e2ea (diff)
downloadmandoc-a705f91ffa6329b5fc3e6c09ce337b0972c19e2e.tar.gz
mandoc-a705f91ffa6329b5fc3e6c09ce337b0972c19e2e.tar.zst
mandoc-a705f91ffa6329b5fc3e6c09ce337b0972c19e2e.zip
Character-set validation fixes.
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index d61be82a..f5e3cc1f 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.37 2008/12/04 16:19:52 kristaps Exp $ */
+/* $Id: roff.c,v 1.38 2008/12/04 16:34:59 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -971,12 +971,20 @@ roffdata(struct rofftree *tree, int space, char *buf)
{
int tok;
+ if (0 == *buf)
+ return(1);
+
if (-1 == (tok = rofftok_scan(buf))) {
roff_err(tree, buf, "invalid character sequence");
return(0);
- } else if (ROFFTok_MAX != tok)
+ } else if (ROFFTok_MAX != tok) {
+ if (ROFFTok_Null == tok) { /* FIXME */
+ buf += 2;
+ return(roffdata(tree, space, buf));
+ }
return((*tree->cb.rofftoken)
(tree->arg, space != 0, tok));
+ }
return((*tree->cb.roffdata)(tree->arg,
space != 0, tree->cur, buf));