diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-07-01 00:32:03 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-07-01 00:32:03 +0000 |
commit | 8d1dbf3c61acb8f8fa68d43c545d1667d9d32a1c (patch) | |
tree | 0bb1512d5a3c0f26a9ec8a9b407ae7654eb8e6f3 /usr.bin | |
parent | 5aff6262067ee7899a92af2ca350794f3a768445 (diff) |
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.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/roff.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index 707efed3332..427371409af 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.87 2014/06/29 23:23:16 schwarze Exp $ */ +/* $Id: roff.c,v 1.88 2014/07/01 00:32:02 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -2014,10 +2014,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; |