summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdoc.c7
-rw-r--r--roff.c11
2 files changed, 14 insertions, 4 deletions
diff --git a/mdoc.c b/mdoc.c
index 38988dbe..9ec50720 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -758,11 +758,14 @@ mdoc_pmacro(struct mdoc *m, int ln, char *buf, int offs)
/*
* Copy the first word into a nil-terminated buffer.
- * Stop copying when a tab, space, or eoln is encountered.
+ * Stop copying when a tab, space, backslash, or eoln is encountered.
*/
j = 0;
- while (j < 4 && '\0' != buf[i] && ' ' != buf[i] && '\t' != buf[i])
+ while (j < 4 && '\0' != buf[i] &&
+ ' ' != buf[i] &&
+ '\t' != buf[i] &&
+ '\\' != buf[i])
mac[j++] = buf[i++];
mac[j] = '\0';
diff --git a/roff.c b/roff.c
index 52a0e344..5cfacbb5 100644
--- a/roff.c
+++ b/roff.c
@@ -59,7 +59,7 @@ enum rofft {
ROFF_rm,
ROFF_tr,
ROFF_cblock,
- ROFF_ccond,
+ ROFF_ccond, /* FIXME: remove this. */
ROFF_nr,
ROFF_MAX
};
@@ -764,8 +764,13 @@ roff_cond_sub(ROFF_ARGS)
if (l != r->last)
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);
- if (ROFF_MAX == (t = roff_parse(*bufp, &pos)))
+ if (ROFF_MAX == (t = roff_parse(*bufp, &pos))) {
+ if ('\\' == (*bufp)[pos] && '}' == (*bufp)[pos + 1])
+ return(roff_ccond
+ (r, ROFF_ccond, bufp, szp,
+ ln, pos, pos + 2, offs));
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT);
+ }
/*
* A denied conditional must evaluate its children if and only
@@ -797,6 +802,8 @@ roff_cond_text(ROFF_ARGS)
* scope permits us to do so.
*/
+ /* FIXME: use roff_ccond? */
+
st = &(*bufp)[pos];
if (NULL == (ep = strstr(st, "\\}"))) {
roffnode_cleanscope(r);