summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-01 00:32:29 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-01 00:32:29 +0000
commit9e7d8bcb8352801ba998920b086e93c8dcad70b3 (patch)
tree52aa64b17c8af781357bbcd635108d73393daea9
parentf270c16631ea1a3d92c80a5de2a3b9a3946d6578 (diff)
downloadmandoc-9e7d8bcb8352801ba998920b086e93c8dcad70b3.tar.gz
The previous commit to this file broke the control flow keywords \{ and \}
when they immediately follow a request or macro name, without intervening whitespace. Minimal fix. The lesson learnt here is that, despite their appearance, \{ and \} are not escape sequences, so never skip them when parsing for names.
-rw-r--r--roff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/roff.c b/roff.c
index d79cf1da..9dfdf7fb 100644
--- a/roff.c
+++ b/roff.c
@@ -2018,10 +2018,12 @@ roff_getname(struct roff *r, char **cpp, int ln, int pos)
}
if ('\\' != *cp)
continue;
+ namesz = cp - name;
+ if ('{' == cp[1] || '}' == cp[1])
+ break;
cp++;
if ('\\' == *cp)
continue;
- namesz = cp - name - 1;
mandoc_msg(MANDOCERR_NAMESC, r->parse, ln, pos, NULL);
mandoc_escape((const char **)&cp, NULL, NULL);
break;