From 355ab2dc6a1499cee84317c7fbe304a5c006c3d1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 1 Jul 2014 00:32:29 +0000 Subject: 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. --- roff.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'roff.c') 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 * Copyright (c) 2010-2014 Ingo Schwarze @@ -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; -- cgit v1.2.3-56-ge451