aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roff.c
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
commit355ab2dc6a1499cee84317c7fbe304a5c006c3d1 (patch)
tree8d0d76e628e52c13312c79d3de2818c2e828753e /roff.c
parent446ce3efe06481ddb1b92bb4339d78e6e364ff4f (diff)
downloadmandoc-355ab2dc6a1499cee84317c7fbe304a5c006c3d1.tar.gz
mandoc-355ab2dc6a1499cee84317c7fbe304a5c006c3d1.tar.zst
mandoc-355ab2dc6a1499cee84317c7fbe304a5c006c3d1.zip
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 'roff.c')
-rw-r--r--roff.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/roff.c b/roff.c
index 511a2cff..465bba79 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.214 2014/06/29 23:26:00 schwarze Exp $ */
+/* $Id: roff.c,v 1.215 2014/07/01 00:32:29 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;